Duplicated test collection when importing #11949
-
When I import a test in another file, pytest duplicates the test case.
When I run
As you can see, This can get a lot worse with class-based tests, since all of them are duplicated. Is this a feature or a bug? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
That's expected, pytest will list the contents of a module to find the tests; even if it was imported from another module, pytest will not do any checks regarding that. I would say it is an unknown feature.
I don't think so, not for test functions. |
Beta Was this translation helpful? Give feedback.
This allows to import whole suite's of Tests into a file with different fixtures