A developer implements a leap-year check but forgets the century rule (years divisible by 100 are leap years only when also divisible by 400):
# calendar_utils.py def is_leap(year): return year % 4 == 0
The test module is:
# test_calendar.py import pytest from calendar_utils import is_leap @pytest.mark.parametrize("year", [2024, 2000]) def test_leap(year): assert is_leap(year) @pytest.mark.parametrize("year", [2023, 1900]) def test_not_leap(year): assert not is_leap(year) def test_rejects_text(): assert is_leap("2024") is False
In the table, each row names a test case by its test and year; the row rejects text is test_rejects_text. Fill in each case's pytest outcome using one of the words passed, failed, error or skipped, then give the number of failed cases and the exit code pytest returns.
Unlock full course notes by signing up
Counting cases and fixture setups in a parametrized pytest module
All of the following code is in one pytest module, test_site.py. Assume every test case runs.
Give each answer as a whole number: the total number of test cases pytest collects, the number of times the setup of browser_session runs, and the number of times the setup of server runs.