(self, pytester: Pytester, import_mode)
| 150 | |
| 151 | @pytest.mark.parametrize("import_mode", ["prepend", "append", "importlib"]) |
| 152 | def test_assertion_rewrite(self, pytester: Pytester, import_mode) -> None: |
| 153 | p = pytester.makepyfile( |
| 154 | """ |
| 155 | def test_this(): |
| 156 | x = 0 |
| 157 | assert x |
| 158 | """ |
| 159 | ) |
| 160 | result = pytester.runpytest(p, f"--import-mode={import_mode}") |
| 161 | result.stdout.fnmatch_lines(["> assert x", "E assert 0"]) |
| 162 | assert result.ret == 1 |
| 163 | |
| 164 | def test_nested_import_error(self, pytester: Pytester) -> None: |
| 165 | p = pytester.makepyfile( |
nothing calls this directly
no test coverage detected