(self, pytester: Pytester)
| 251 | assert funcnames == ["T.test_hello", "test_someting"] |
| 252 | |
| 253 | def test_mock_sorting(self, pytester: Pytester) -> None: |
| 254 | pytest.importorskip("mock", "1.0.1") |
| 255 | pytester.makepyfile( |
| 256 | """ |
| 257 | import os |
| 258 | import mock |
| 259 | |
| 260 | @mock.patch("os.path.abspath") |
| 261 | def test_one(abspath): |
| 262 | pass |
| 263 | @mock.patch("os.path.abspath") |
| 264 | def test_two(abspath): |
| 265 | pass |
| 266 | @mock.patch("os.path.abspath") |
| 267 | def test_three(abspath): |
| 268 | pass |
| 269 | """ |
| 270 | ) |
| 271 | reprec = pytester.inline_run() |
| 272 | calls = reprec.getreports("pytest_runtest_logreport") |
| 273 | calls = [x for x in calls if x.when == "call"] |
| 274 | names = [x.nodeid.split("::")[-1] for x in calls] |
| 275 | assert names == ["test_one", "test_two", "test_three"] |
| 276 | |
| 277 | def test_mock_double_patch_issue473(self, pytester: Pytester) -> None: |
| 278 | pytest.importorskip("mock", "1.0.1") |
nothing calls this directly
no test coverage detected