(pytester: Pytester)
| 10 | |
| 11 | @pytest.fixture() |
| 12 | def file_structure(pytester: Pytester) -> None: |
| 13 | pytester.makepyfile( |
| 14 | test_foo=""" |
| 15 | from foo import foo |
| 16 | |
| 17 | def test_foo(): |
| 18 | assert foo() == 1 |
| 19 | """ |
| 20 | ) |
| 21 | |
| 22 | pytester.makepyfile( |
| 23 | test_bar=""" |
| 24 | from bar import bar |
| 25 | |
| 26 | def test_bar(): |
| 27 | assert bar() == 2 |
| 28 | """ |
| 29 | ) |
| 30 | |
| 31 | foo_py = pytester.mkdir("sub") / "foo.py" |
| 32 | content = dedent( |
| 33 | """ |
| 34 | def foo(): |
| 35 | return 1 |
| 36 | """ |
| 37 | ) |
| 38 | foo_py.write_text(content, encoding="utf-8") |
| 39 | |
| 40 | bar_py = pytester.mkdir("sub2") / "bar.py" |
| 41 | content = dedent( |
| 42 | """ |
| 43 | def bar(): |
| 44 | return 2 |
| 45 | """ |
| 46 | ) |
| 47 | bar_py.write_text(content, encoding="utf-8") |
| 48 | |
| 49 | |
| 50 | def test_one_dir(pytester: Pytester, file_structure) -> None: |
nothing calls this directly
no test coverage detected