(pytester: Pytester)
| 86 | |
| 87 | |
| 88 | def test_setUpModule(pytester: Pytester) -> None: |
| 89 | testpath = pytester.makepyfile( |
| 90 | """ |
| 91 | values = [] |
| 92 | |
| 93 | def setUpModule(): |
| 94 | values.append(1) |
| 95 | |
| 96 | def tearDownModule(): |
| 97 | del values[0] |
| 98 | |
| 99 | def test_hello(): |
| 100 | assert values == [1] |
| 101 | |
| 102 | def test_world(): |
| 103 | assert values == [1] |
| 104 | """ |
| 105 | ) |
| 106 | result = pytester.runpytest(testpath) |
| 107 | result.stdout.fnmatch_lines(["*2 passed*"]) |
| 108 | |
| 109 | |
| 110 | def test_setUpModule_failing_no_teardown(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected