How to test for ImportError or ModuleNotFoundError being handled correctly? #12864
-
I have a module that has in its
The structure of the module is as follows:
How can I test that a |
Beta Was this translation helpful? Give feedback.
Answered by
RonnyPfannschmidt
Oct 8, 2024
Replies: 1 comment 2 replies
-
That particular kind of import hack is best tested by using a subprocess Personally id strongly recomend to avoid that pattern With more context i may be able to recommend a more testable pattern |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Putting imports into except is only done in case of externals being optional
Its never the default