Closed kloczek closed 11 months ago
@kloczek You have hit another project those tests do not run using pytest
, see https://github.com/malthe/chameleon/blob/e64dc4fa3921cfaa886cab6c766f7237ebb2f3a3/tox.ini#L16 how to run the tests for this project.
It is one very good reason to support pytest. That framework provides way better flexilibily of testing by just install pytest extension. zope.testrunner
is more and more behind what pytest can do.
Just one stat from my library of rpm spec files used to build python modules
[tkloczko@devel-g2v SPECS]$ grep ^%pytest python-* | wc -l; ls -1 python-* | wc -l
802
904
With that I'm able to asses quality of all those modules just by performe mass test build with added exact pytest extension to build env.
I'm not asking to move away from zope.testrunner
. I'm only asking to have quick look on what needs to be done to be able use chameleon
with pytest .. only this and nothing more 😃
Maybe necessary adaptations are really easy/simple 🙂
Just FTR: retested 3.10.1 and lookd like pytest still is failing the same way.
Just tested 4.0.1 and here is pytest output:
And version 4.1, 5.0, … will fail running the tests using pytest. Just please accept the decisions of the developers and maintainers of this project.
There are as well some deprecation warnings ..
And version 4.1, 5.0, … will fail running the tests using pytest.
Currently test suite uses unittest
.
pytest
can handle correctly written unittest
based test suite.
Just tested 4.3.0 and now test suite fails with more errors.
BTW build
shows some warnings as well
Other thing is that test suite is part of the installed resources however looks like this is result of use relative imports in src/chameleon/tests code which does not allow move around that code (for example move to tests/)
@kloczek agreed that the tests could be updated (and in particular, moved out from the source code).
@kloczek agreed that the tests could be updated (and in particular, moved out from the source code).
To be able do that first needs to be replaced all relative imports. Than test suite can be moved around without causing errors/fails.
Use relative imports is nothing more than than asking for troubles. Additionally each relative import causes additional syscall to obtain current directory.
@kloczek I don't think Zope's test runner supports moving tests outside of the "package under test", or at least it needs to live inside a proper package.
To get any further here, we'd need to change to another test runner, e.g. pytest. PRs are welcome!
OK I made https://github.com/malthe/chameleon/pull/400 which removes use relative imports. Any progress on other issues? 🤔
@kloczek how does this work for you?
Ha .. just found that you moved to pytest 😄 Will check that in next few hours and back to you ASP 👍
Closing this issue for now, but if this doesn't quite work for RPM packaging, let's reopen and sort out any remaining issues.
Looks like 4.4.3 test suite is OK now (thank you). It is yet another small issue. test suite is part of installed resources (content of the chameleon/tests/). Easiest way to fix that would be move chameleon/tests/ to tests/.
I'm trying to package your module as an rpm package. So I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
python3 -sBm build -w --no-isolation
build
with--no-isolation
I'm using during all processes only locally installed modulesHere is pytest output: