Better Python Unit Tests
Событие уже в прошлом
|Специализация:||В основном Python|
|Страница в сети:||https://www.eventbrite.com/e/better-python-unit-tests-tickets-104843375358|
Join Silicon Valley python expert Moshe Zadka as he reveals how to write unit tests like a pro in this detailed virtual training course. Learn what is a unit test, how to write one, how to read unit test failures, and how to use pytest/unittest.mock to write unit tests and integrate them into your workflow. Level up your python programming skills in this rare course taught by a respected industry veteran. Below is a detailed outline of what to expect in this course: Course outline: Intro Mechanics: Jupyter, Pytest, writing and running tests (10m)Pytest assertions (20m)EqualityOrder comparisonsIn/not inRaising exceptionsHands-on: Fix these tests (10m)Fixing tests that fail with instructions «only change this line»Hands-on Recap -- what we learned (5m)Mocking basics (20m)Mock vs. Magic MockNaming mocksSpecifying mock interfaceHands on: Fix those mocks (10m)Fixing mocks to make tests passHands on Recap -- what we learned (5m)Process: Fixing bug by writing a unit test (20m)Example 1: Function failing if string is too long (10m)Example 2: Function failing if number is negative (10m)Hands on: Fix this function (10m)Write failing unit testCheck that it failsFix functionCheck that it passesHands on Recap -- what we learned (5m)Conclusion and parting thoughts (5m)Prerequisites:Running Jupyter with pytest and ipython_pytest installed(In a working Python environment, «pip install jupyterlab pytest ipython_pytest»)Python 3.6+Experience with: basic Python data structures (list, dict, set, tuple)Experience with writing and calling functionsExperience with writing classesNo experience with unittest, pytest or unittest.mock will be assumeInstructor bio:Moshe has been programming Python since 1999, and has contributed to the core Python interpreter. He is a founding member of the Twisted project, which has consistently drove for high-quality unit tests for all new code. He has given tutorials at PyCon and PyBay, and talks in most regional Python conferences in the US.