with pytest warnings are generated when importing in test file.
e.g. from junitparser import JUnitXml, TestSuite
generates a warning when pytest is executed:
PytestCollectionWarning: cannot collect test class 'TestSuite' because it has a __init__ constructor (from: tests/test_utils.py)
class TestSuite(Element):
It seems like the fix is to add __test__ = False to each class that starts with Test*
I happy to make that pull request but not sure if that is the best solution.
EDIT: when running pytest against the junitparser project it gives me similar warnings and when __test__ = False is added to TestCase and TestSuite the warnings go away.
with pytest warnings are generated when importing in test file. e.g.
from junitparser import JUnitXml, TestSuite
generates a warning when pytest is executed:
It seems like the fix is to add
__test__ = False
to each class that starts withTest*
I happy to make that pull request but not sure if that is the best solution.
EDIT: when running
pytest
against thejunitparser
project it gives me similar warnings and when__test__ = False
is added toTestCase
andTestSuite
the warnings go away.EDIT: #125 includes the fix for the warnings.