()
| 43 | |
| 44 | |
| 45 | def test_require_module_with_mitigation_import_error(): |
| 46 | with pytest.raises(ImportError) as exc_info: |
| 47 | require_module("nonexistent_module.submodule", mitigation="custom_package") |
| 48 | |
| 49 | exception_msg = str(exc_info.value) |
| 50 | assert "Required package 'custom_package' is not installed." in exception_msg |
| 51 | assert ( |
| 52 | "Module 'nonexistent_module.submodule' is part of 'nonexistent_module'" |
| 53 | in exception_msg |
| 54 | ) |
| 55 | assert "please pip install 'custom_package'." in exception_msg |
| 56 | |
| 57 | |
| 58 | def test_require_module_submodule_import_error(): |
nothing calls this directly
no test coverage detected