()
| 56 | |
| 57 | |
| 58 | def test_require_module_submodule_import_error(): |
| 59 | with pytest.raises(ImportError) as exc_info: |
| 60 | require_module("os.nonexistent_submodule") |
| 61 | |
| 62 | exception_msg = str(exc_info.value) |
| 63 | assert ( |
| 64 | "Required package 'os.nonexistent_submodule' is not installed." in exception_msg |
| 65 | ) |
| 66 | assert "Module 'os.nonexistent_submodule' is part of 'os'" in exception_msg |
| 67 | assert "please pip install 'os'." in exception_msg |
| 68 | |
| 69 | |
| 70 | @patch("importlib.import_module") |
nothing calls this directly
no test coverage detected