Artwork

Вміст надано Real Python. Весь вміст подкастів, включаючи епізоди, графіку та описи подкастів, завантажується та надається безпосередньо компанією Real Python або його партнером по платформі подкастів. Якщо ви вважаєте, що хтось використовує ваш захищений авторським правом твір без вашого дозволу, ви можете виконати процедуру, описану тут https://uk.player.fm/legal.
Player FM - додаток Podcast
Переходьте в офлайн за допомогою програми Player FM !

Eric Matthes: Maybe Don't Start With Unit Tests

1:10:48
 
Поширити
 

Manage episode 470148880 series 2637014
Вміст надано Real Python. Весь вміст подкастів, включаючи епізоди, графіку та описи подкастів, завантажується та надається безпосередньо компанією Real Python або його партнером по платформі подкастів. Якщо ви вважаєте, що хтось використовує ваш захищений авторським правом твір без вашого дозволу, ви можете виконати процедуру, описану тут https://uk.player.fm/legal.

Should you always start testing your code with unit tests? When does it make sense to look at integration or end-to-end testing as a first step instead? This week on the show, we speak with previous guest Eric Matthes about where to begin testing your code.

Eric is the author of the popular book Python Crash Course. Early in the development of the book, he decided to introduce testing and added a chapter on testing code with pytest.

Over the past couple of years, Eric has continued to consider when and where to test a project’s code. He thinks there are hazards to always starting with unit tests. The type of project and its audience should determine what kind of testing to employ initially.

We discuss using pytest to develop integration tests on multiple types of projects. We also explore fixtures and what goes into building a test suite. Eric also shares criteria for when and where it makes sense to add unit tests to a project.

Course Spotlight: Using Python’s assert to Debug and Test Your Code

In this course, you’ll learn how to use Python’s assert statement to document, debug, and test code in development. You’ll learn how assertions might be disabled in production code, so you shouldn’t use them to validate data. You’ll also learn about a few common pitfalls of assertions in Python.

Topics:

  • 00:00:00 – Introduction
  • 00:01:47 – Submitting talks to conferences
  • 00:04:10 – Don’t start with unit tests!
  • 00:07:35 – How did you start with testing?
  • 00:11:30 – Example of a project needing tests
  • 00:14:54 – Defining types of tests
  • 00:16:44 – Integration vs end-to-end tests
  • 00:19:09 – When should you build tests?
  • 00:22:13 – Trade offs of integration vs unit tests
  • 00:24:05 – Why is there push back on this idea?
  • 00:27:36 – Video Course Spotlight
  • 00:29:09 – Using pytest
  • 00:33:24 – Transcripts project example
  • 00:37:03 – py-image-border project
  • 00:40:29 – Criteria for when you should write unit tests
  • 00:48:51 – How to practice writing tests
  • 00:50:28 – Building an integration test and pytest fixtures
  • 00:55:05 – What’s in the test folder?
  • 00:56:31 – Idea for a PyCon tutorial on implementing tests
  • 00:57:29 – Other pytest advice and parametrization
  • 01:01:13 – Caveats to not starting with unit tests
  • 01:02:30 – pytest documentation and other advice
  • 01:05:23 – How to reach Eric online
  • 01:06:47 – What are you excited about in the world of Python?
  • 01:08:23 – What do you want to learn next?
  • 01:09:48 – What conferences are you attending?
  • 01:10:06 – Thanks and goodbye

Show Links:

Level up your Python skills with our expert-led courses:

Support the podcast & join our community of Pythonistas

  continue reading

264 епізодів

Artwork
iconПоширити
 
Manage episode 470148880 series 2637014
Вміст надано Real Python. Весь вміст подкастів, включаючи епізоди, графіку та описи подкастів, завантажується та надається безпосередньо компанією Real Python або його партнером по платформі подкастів. Якщо ви вважаєте, що хтось використовує ваш захищений авторським правом твір без вашого дозволу, ви можете виконати процедуру, описану тут https://uk.player.fm/legal.

Should you always start testing your code with unit tests? When does it make sense to look at integration or end-to-end testing as a first step instead? This week on the show, we speak with previous guest Eric Matthes about where to begin testing your code.

Eric is the author of the popular book Python Crash Course. Early in the development of the book, he decided to introduce testing and added a chapter on testing code with pytest.

Over the past couple of years, Eric has continued to consider when and where to test a project’s code. He thinks there are hazards to always starting with unit tests. The type of project and its audience should determine what kind of testing to employ initially.

We discuss using pytest to develop integration tests on multiple types of projects. We also explore fixtures and what goes into building a test suite. Eric also shares criteria for when and where it makes sense to add unit tests to a project.

Course Spotlight: Using Python’s assert to Debug and Test Your Code

In this course, you’ll learn how to use Python’s assert statement to document, debug, and test code in development. You’ll learn how assertions might be disabled in production code, so you shouldn’t use them to validate data. You’ll also learn about a few common pitfalls of assertions in Python.

Topics:

  • 00:00:00 – Introduction
  • 00:01:47 – Submitting talks to conferences
  • 00:04:10 – Don’t start with unit tests!
  • 00:07:35 – How did you start with testing?
  • 00:11:30 – Example of a project needing tests
  • 00:14:54 – Defining types of tests
  • 00:16:44 – Integration vs end-to-end tests
  • 00:19:09 – When should you build tests?
  • 00:22:13 – Trade offs of integration vs unit tests
  • 00:24:05 – Why is there push back on this idea?
  • 00:27:36 – Video Course Spotlight
  • 00:29:09 – Using pytest
  • 00:33:24 – Transcripts project example
  • 00:37:03 – py-image-border project
  • 00:40:29 – Criteria for when you should write unit tests
  • 00:48:51 – How to practice writing tests
  • 00:50:28 – Building an integration test and pytest fixtures
  • 00:55:05 – What’s in the test folder?
  • 00:56:31 – Idea for a PyCon tutorial on implementing tests
  • 00:57:29 – Other pytest advice and parametrization
  • 01:01:13 – Caveats to not starting with unit tests
  • 01:02:30 – pytest documentation and other advice
  • 01:05:23 – How to reach Eric online
  • 01:06:47 – What are you excited about in the world of Python?
  • 01:08:23 – What do you want to learn next?
  • 01:09:48 – What conferences are you attending?
  • 01:10:06 – Thanks and goodbye

Show Links:

Level up your Python skills with our expert-led courses:

Support the podcast & join our community of Pythonistas

  continue reading

264 епізодів

सभी एपिसोड

×
 
Loading …

Ласкаво просимо до Player FM!

Player FM сканує Інтернет для отримання високоякісних подкастів, щоб ви могли насолоджуватися ними зараз. Це найкращий додаток для подкастів, який працює на Android, iPhone і веб-сторінці. Реєстрація для синхронізації підписок між пристроями.

 

Короткий довідник

Слухайте це шоу, досліджуючи
Відтворити