(self)
| 486 | self.assertNotIn(b'Traceback', err) |
| 487 | |
| 488 | def test_dash_m_bad_pyc(self): |
| 489 | with os_helper.temp_dir() as script_dir, \ |
| 490 | os_helper.change_cwd(path=script_dir): |
| 491 | os.mkdir('test_pkg') |
| 492 | # Create invalid *.pyc as empty file |
| 493 | with open('test_pkg/__init__.pyc', 'wb'): |
| 494 | pass |
| 495 | err = self.check_dash_m_failure('test_pkg') |
| 496 | self.assertRegex(err, |
| 497 | br'Error while finding module specification.*' |
| 498 | br'ImportError.*bad magic number') |
| 499 | self.assertNotIn(b'is a package', err) |
| 500 | self.assertNotIn(b'Traceback', err) |
| 501 | |
| 502 | def test_hint_when_triying_to_import_a_py_file(self): |
| 503 | with os_helper.temp_dir() as script_dir, \ |
nothing calls this directly
no test coverage detected