(self)
| 619 | "<sys>") |
| 620 | |
| 621 | def test_stacklevel_import(self): |
| 622 | # Issue #24305: With stacklevel=2, module-level warnings should work. |
| 623 | import_helper.unload('test.test_warnings.data.import_warning') |
| 624 | with warnings_state(self.module): |
| 625 | with self.module.catch_warnings(record=True) as w: |
| 626 | self.module.simplefilter('always') |
| 627 | import test.test_warnings.data.import_warning # noqa: F401 |
| 628 | self.assertEqual(len(w), 1) |
| 629 | self.assertEqual(w[0].filename, __file__) |
| 630 | |
| 631 | def test_skip_file_prefixes(self): |
| 632 | with warnings_state(self.module): |
nothing calls this directly
no test coverage detected