Testing circular imports using pytest
#12124
-
I'm looking for some way of testing module code against circular imports. |
Beta Was this translation helpful? Give feedback.
Answered by
Pierre-Sassoulas
Mar 16, 2024
Replies: 1 comment 2 replies
-
Probably pytest is not a good fit for this, because it imports modules to analyse them, which will break if there are circular imports. It is probably best done by a tool which analyses the files without importing. |
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
Pylint can do that with
--enable=cyclic-import
and there's a pylint-pytest plugin if you really want to have it included in pytest.