Closed kloczek closed 3 years ago
Hi,
the issue seems to be limited to the TDOP base parser tests. The ExpressionParser's symbol_table might be cleared before the tests are executed.
I tried to reproduce the errors adding a section for pytest to tox.ini
:
[testenv:pytest]
deps =
pytest
py
pluggy
lxml
xmlschema>=1.2.3
commands =
pytest tests -ra
# pytest tests -ra -p no:randomly
but in my case tests run without failures. Maybe i forgot a dependency, I don't know.
Found the problem after adding pytest-randomly package: is a missing statement in TdopParserTest.test_unkown_symbol
:
parser = self.parser.__class__()
parser.symbol_table = parser.symbol_table.copy() # duplicate parser class's symbol table
parser.build()
parser.symbol_table.pop('+')
Usually a duplication of the symbol table is not needed, but in this case a symbol is removed for testing.
The fix will be available in the next release.
Thanks
Please let me know when you will have fix for that. I'll be glad to test that ASAP :)
Hi, release v2.3.1 is available. I close this, if it still not works for you reopen the issue.
Tested three times 2.3.1 without disabled randomly plugin and no fails and all looks clean. Thank you :)
I also added a pytest env to tox.ini for testing this:
[testenv:pytest]
deps =
pytest
pytest-randomly
lxml
xmlschema>=1.2.3
commands =
pytest tests -ra
Looks like tehre are some depenndencies between units. Two examples:
As long as
pytest-randomly
is disabled pytest is OK.To resolve that kind of issues https://github.com/mrbean-bremen/pytest-find-dependencies/ needs to be used.