(pytester: Pytester)
| 77 | |
| 78 | |
| 79 | def test_fscollector_gethookproxy_isinitpath(pytester: Pytester) -> None: |
| 80 | module = pytester.getmodulecol( |
| 81 | """ |
| 82 | def test_foo(): pass |
| 83 | """, |
| 84 | withinit=True, |
| 85 | ) |
| 86 | assert isinstance(module, pytest.Module) |
| 87 | package = module.parent |
| 88 | assert isinstance(package, pytest.Package) |
| 89 | |
| 90 | with pytest.warns(pytest.PytestDeprecationWarning, match="gethookproxy"): |
| 91 | package.gethookproxy(pytester.path) |
| 92 | |
| 93 | with pytest.warns(pytest.PytestDeprecationWarning, match="isinitpath"): |
| 94 | package.isinitpath(pytester.path) |
| 95 | |
| 96 | # The methods on Session are *not* deprecated. |
| 97 | session = module.session |
| 98 | with warnings.catch_warnings(record=True) as rec: |
| 99 | session.gethookproxy(pytester.path) |
| 100 | session.isinitpath(pytester.path) |
| 101 | assert len(rec) == 0 |
| 102 | |
| 103 | |
| 104 | def test_strict_option_is_deprecated(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected