()
| 700 | ) |
| 701 | |
| 702 | def test_builtin__import__(): |
| 703 | import importlib # noqa: F401 |
| 704 | |
| 705 | with TestHook() as hook: |
| 706 | __import__("importlib") |
| 707 | __import__("email") |
| 708 | __import__("pythoninfo") |
| 709 | __import__("audit_test_data.submodule", level=1, globals={"__package__": "test"}) |
| 710 | __import__("test.audit_test_data.submodule2") |
| 711 | __import__("_testcapi") |
| 712 | |
| 713 | actual = [a for e, a in hook.seen if e == "import"] |
| 714 | assertSequenceEqual( |
| 715 | [ |
| 716 | ("email", None, sys.path, sys.meta_path, sys.path_hooks), |
| 717 | ("pythoninfo", None, sys.path, sys.meta_path, sys.path_hooks), |
| 718 | ("test.audit_test_data.submodule", None, sys.path, sys.meta_path, sys.path_hooks), |
| 719 | ("test.audit_test_data", None, sys.path, sys.meta_path, sys.path_hooks), |
| 720 | ("test.audit_test_data.submodule2", None, sys.path, sys.meta_path, sys.path_hooks), |
| 721 | ("_testcapi", None, sys.path, sys.meta_path, sys.path_hooks), |
| 722 | ("_testcapi", unittest.mock.ANY, None, None, None) |
| 723 | ], |
| 724 | actual, |
| 725 | ) |
| 726 | |
| 727 | def test_import_statement(): |
| 728 | import importlib # noqa: F401 |
nothing calls this directly
no test coverage detected
searching dependent graphs…