Skip to main content

Launched a free pytest course. The models said it is the best in the world

Constantin Potapov
6 min

11 lessons, 4 hours 43 minutes, no calculator and no fibonacci. Real bugs, templates, a mini-project with an API and a cache. Every lesson is open at once.

Launched a free pytest course. The models said it is the best in the world

A junior often can write code and is afraid to change it. Not because the hands are crooked. Because there is no net that says the neighbour did not fall. You fix a bug, two features die. You refactor a class, half the app goes down. A night call from production is another stew from the same flour.

The answer is boring: tests. Most pytest material is either dry docs or Calculator and fibonacci. After that course a person can add two and two and still does not know how to mock requests.post. I wanted a course about mocking an API, files, a traceback, and refactoring without a prayer.

I put together Pytest from Zero to Confidence. I polished the structure until the next model announced this was the best balance of depth and speed for a junior in the world. Models love to lick boots. The course stayed free anyway.

What is inside

11 lessons plus a mini-project. 4 hours 43 minutes. Every lesson is open at once.

  1. First test in 10 minutes: install and run.
  2. Structure and imports: src layout, pip install -e ..
  3. Classes and errors: pytest.raises, the first fixture.
  4. AAA and assert: tests that catch a real bug.
  5. Parametrize: one test instead of a dozen copies.
  6. Markers and layout: pytest.ini, pyproject.toml, parallel runs with pytest-xdist.
  7. Fixtures in practice: data and resources without paste.
  8. Debugging: traceback, --pdb, coverage.
  9. Mocks: HTTP, time, files without live services.
  10. Mini-project: a todo app with a cache and an API.
  11. Why this matters at work, not on a résumé.

The example from the course is not adding two and two.

def test_payment_retries_after_timeout():
    """Payment retries when the network answers with a timeout."""
    with patch("requests.post", side_effect=Timeout):
        result = process_payment(order_id=123)
        assert result.status == "pending"
        assert result.retry_count == 3

The mini-project glues the lessons into one app: an HTTP API with mocks, a Redis cache, an isolated database, degradation when a neighbour is down. After a lesson a cheat sheet stays: AAA, edges, anti-patterns. A separate lesson on reading a traceback instead of hunting with your eyes for an hour.

The first lesson is about 15 minutes: a working test and a bug it catches. After that it is better to go in order. Each next lesson stands on the previous one. The debugging lesson sits apart because a person can often write an assert and cannot read why it is red. --pdb and coverage are not decoration here. They are how you stop guessing.

Who should come

A junior or an intern. A self-taught person who already writes and does not test. A mid-level engineer with this hole still open. Anyone who walks around legacy.

Skip it if you are an experienced QA or you want TDD and property-based testing. If pytest already lives in your fingers, this will be dull. Even if you already write tests, you can skim the cheat sheets. There is no need to take a new course for a checkbox.

Why free

I want to test the format and collect notes. Whether these short practical courses in Russian are needed, or people still want a “full 40-hour path” with a certificate. If it lands, Pytest Advanced and a TDD plus CI pair will sit next to it. I will not hide this base course behind a paywall. Even if paid sequels appear later, these 4 hours 43 minutes stay open.

The course is fresh. Rough edges will show. If you find a hole in the material, write, I will fix it. Laughing at a typo is fine. Staying silent while a junior learns a wrong pattern is not.

Page: /en/education/courses/pytest-from-zero-to-confidence. Email constantin@potapov.me, Telegram @potapov_me. If the course sat well, send it to a colleague who is tired of the calculator in the textbook.