(self, pytester: Pytester)
| 21 | pytest.raises(Collector.CollectError, modcol.collect) |
| 22 | |
| 23 | def test_import_duplicate(self, pytester: Pytester) -> None: |
| 24 | a = pytester.mkdir("a") |
| 25 | b = pytester.mkdir("b") |
| 26 | p1 = a.joinpath("test_whatever.py") |
| 27 | p1.touch() |
| 28 | p2 = b.joinpath("test_whatever.py") |
| 29 | p2.touch() |
| 30 | # ensure we don't have it imported already |
| 31 | sys.modules.pop(p1.stem, None) |
| 32 | |
| 33 | result = pytester.runpytest() |
| 34 | result.stdout.fnmatch_lines( |
| 35 | [ |
| 36 | "*import*mismatch*", |
| 37 | "*imported*test_whatever*", |
| 38 | "*%s*" % p1, |
| 39 | "*not the same*", |
| 40 | "*%s*" % p2, |
| 41 | "*HINT*", |
| 42 | ] |
| 43 | ) |
| 44 | |
| 45 | def test_import_prepend_append( |
| 46 | self, pytester: Pytester, monkeypatch: MonkeyPatch |
nothing calls this directly
no test coverage detected