LernerPython

Pytest

Want to ensure your Python code is reliable? You need to test it — and “pytest” is the best way to do that.

What you should know

Course Content

Course length

4 hours

Number of lessons

1

Training materials

Jupyter notebook and files

Coding exercises

6

LEARN MORE

If you’re using Python for your personal enjoyment, then it doesn’t really matter how robust the code is. But if you’re using Python in mission-critical applications for your company, then making sure that your code is bulletproof isn’t just a good idea — it’s pretty much mandatory. And the best way to ensure that your code is ready for prime time is to test it thoroughly.

But testing doesn’t just make your code more reliable: It also makes you a more productive developer. You can concentrate on developing new features and fixing old bugs, rather than accidentally introducing new ones. Once you get started testing, it’ll be hard for you to stop.

Over the last few years, pytest has emerged as an easy to use, popular way to test Python code. pytest is written in Python, and is designed to be used by Python developers in testing Python code. It uses Python programming idioms and paradigms, giving experienced Python developers a seamless experience and a shallow learning curve.

In this live, 4-hour course, I’ll introduce you to pytest — what it is, how it works, and how to use it. There will be numerous exercises and many opportunities for you to ask me questions.

Watch the recording of this live, online course from September 2020, and you’ll come away with knowledge that you can put to use immediately. Your software will improve, and so will your career!

  • Why test?
  • Basic pytest installation
  • Assertions
  • Command-line arguments
  • Exceptions
  • Parametrized tests
  • Fixtures

As with all courses on LernerPython.com, this class is taught by Reuven Lerner.