New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI:Pin pytest version to 7.0.1 on Azure #15783
Conversation
But at least the pytest mark issue is resolved. |
f81b41f
to
ee34280
Compare
Well, after digging in a bit more I found #10178 so apparently pytest.ini is a no go. But then the question is why |
The problem is that the new pytest version is not taking |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But then the question is why conftest.py is not being picked up suddenly.
It may be because the runtests.py
stuff is messing around with PYTHONPATH
but the new version of pytest
fixes a bug:
pytest-dev/pytest#9645: Fixed regression where --import-mode=importlib used together with PYTHONPATH{.interpreted-text role="envvar"} or pythonpath{.interpreted-text role="confval"} would cause import errors in test suites.
If I do cd /tmp
, then pytest --pyargs scipy
, it works with the new pytest
+ the installed version of SciPy. This approach is noted in doc/source/dev/contributor/meson.rst
.
For the immediate Azure CI problem, the only thing I don't know how to do with pytest
directly is --mode=$(TEST_MODE)
, but then I'm confused about pytest.ini
not being available in that situation since we probe an installed version of SciPy?
In fact, I can reproduce the missing marks error locally with i.e.,:
Can run that just fine with the older |
You might be right. I looked into that possibility but clearly you had a better grasp of it. There are more people piling up in pytest-dev/pytest#9767 and it seems like it is a combination of different things for now. It seems to me that our We might want to streamline the test invocation a bit. |
Agreed! If we do this, I suppose we should update What about pinning the version of pytest for now while we investigate, otherwise we cannot rely on half of our CI. |
Pinning pytest for now seems like the right thing to do. |
There is definitely nothing wrong with it but it is not necessarily the right way to collect tests anymore given the pytest automation level. It is probably won't be the case that we will ever switch to a less-able testing framework anyways hence we can actually gather the test options directly with a clean pytest invocation. I'll pin the version for now since there is a consensus. It is only affecting windows workflows apparently given in the pytest issue linked above. I'll only change it in the azure CI template |
ee34280
to
6584713
Compare
You're welcome to try of course, but I'm not convinced it's a healthy idea yet. |
Yes some PYTHONPATH modification is necessary but can be done in a much cleaner way. Interesting that , we have the complete opposite experience with it but maybe I am not seeing completely what you have in mind. I am not using any virtual envs and I can test any installed package. But if you mean the |
[skip actions] [skip circle]
6584713
to
ec53102
Compare
Not sure I understand what you mean by "poor at collecting tests". I am actually never using |
So apparently we are still using both azure templates in some jobs, I'll fix both. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, aside from the usual timeout it's now green so let's get this in and keep the issue open to follow up. Thanks @ilayn
I mean the UX is bad. The equivalent of
I had to look that up, because I can never remember. If
You can save that as test command in an IDE, but it's far from ideal.
The point is that if you have for example packages from your package manager on Ubuntu, then there's nowhere good to install to. You may see a permissions error and be tempted to use
That's indeed yet another thing you lose. It's quite handy in (for example) IPython if you want to check if there's an issue with your build. It works in notebooks too where you may not have a terminal at hand. |
I think what @tupui and I am leaning towards is the collection of tests within I don't know about you but that code is seriously intertwined with names like |
Isn't that just part of gh-15489? I agree it needs splitting up. The way |
Yes it is. @ilayn just noted here that it was difficult to debug due to the complexity of |
Ah yes. That's it. |
Reference issue
Closes #15780
What does this implement/fix?
It seems that the
conftest.py
is only taken into account in meson builds (I think). Hence I am testing whether adding the markers explicitly to pytest.ini file would help.