Pytest\'s default discovery rules will import all Class starting with Test that do not have an __init__(). I have a situation where this causes an
Test
__init__()
Here is a simple solution that I use, but has some overhead.
class DisablePyTestCollectionMixin(object): __test__ = False class TestimonialFactory(DisablePyTestCollectionMixin): pass
Based on: https://github.com/pytest-dev/pytest/issues/1879