()
| 12 | |
| 13 | |
| 14 | def test_import_optional(): |
| 15 | match = "Import .*notapackage.* pip .* conda .* notapackage" |
| 16 | with pytest.raises(ImportError, match=match) as exc_info: |
| 17 | import_optional_dependency("notapackage") |
| 18 | # The original exception should be there as context: |
| 19 | assert isinstance(exc_info.value.__context__, ImportError) |
| 20 | |
| 21 | result = import_optional_dependency("notapackage", errors="ignore") |
| 22 | assert result is None |
| 23 | |
| 24 | |
| 25 | def test_xlrd_version_fallback(): |
nothing calls this directly
no test coverage detected