Closed kloczek closed 5 years ago
What lead you to believe that setup.py test
would work?
What are you looking to achieve?
This is not matter of believing in anything. If source code tree provides test suite I'm trying to use it on packaging stage. It fails and I'm reporting this. Only this and nothing more.
Okay, but setup.py test
isn't documented for this project that I can find. If it is, please let me know where so I can correct it.
For this project, the correct way to run the tests is to use the same methodology the CI does:
pip install -e .[dev]
pytest
You haven't provided any context about why you're running the tests, so I can't help you more.
@kloczek, FTR, I've been able to run the tests without this absurd voodoo by using plain unittest, i.e.:
PYTHONPATH=. python -m unittest discover
Note that this doesn't handle pytest-specific conftest.py
, so you have to deal with removing *py3*
for Python 2 testing yourself.
@mgorny - I find the tone of your comment unpleasant, please consider how terms like "absurd voodoo" might be perceived by others.
You appear to want to go out of your way to not run the tests in the way prescribed by the project. That is confusing and likely to lead you into problems.
As I said above, the correct way to run the test suite for this project is:
pip install -e .[dev]
pytest
What is preventing you from doing that?
For a start, we want to check whether the package works before it's installed into user's system. And we want to have it installed and tracked via the system package manager, not pip.
Who is "we" here?
If you want a system package, you should build a system package, and the test that in isolation before making in generally available. You will have to deal with testing-only dependencies (pytest in this case), which I guess you could model using build-time deps.
You still need to use the testing methodology the package has, rather than ignoring the package's requirements, trying to do your own (incorrect) thing and then complaining when it doesn't work.
We is Gentoo. But the problem applies to all source distributions where things are built on user systems. I would be happy to use package's 'testing methodology' if it worked. But it doesn't, and I don't have all the time in the world to figure out how to make it work without having to break user systems in the process.
I'm sorry, but the nightly running CI doesn't agree with your assessment: https://circleci.com/gh/testing-cabal/mock/tree/master
'It works in our pristine environment, so we're going to ignore that it fails for everybody else' is not a very helpful attitude.
It looks like you're not going to be happy with any reasonable answer, so I think this conversation is done.