-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Test collecting errors with pytest 3.2.0 #6418
Comments
I'll take a look to see if I can fix it as part of #6415 |
Ah sorry you are looking into a solution, so ignore me. I'll leave you to take a look :) |
I would suggest let's just try and fix it and only restrict the pytest version if a fix isn't easy. |
The solution seems to be trivial, PR is coming soon. |
I guess this means open PRs will need to be rebased onto your fix once it's merged? |
@drdavella - yes, either way they need to get the circleCI pass. |
Thanks, @bsipocz. I started working on this exact same thing this morning, but got interrupted by meetings. |
@larrybradley - No problem. However we run into new issues that relates to a bug (or at least I think it's a bug), so there will be a version limitation in ci-helpers for pytest <3.2 for a while. |
So... Does this affect affiliated packages? 😱 |
photutils and astroquery are fine, but it may affect others, too. This actually only had a few month long deprecation period, and no warnings were issued before this error, so I'm not sure how we were supposed to notice it in time. |
|
A follow-up on this based on the discussion over there in the pytest repo. They haven't yet removed this deprecation but raise a deprecation warning. We see it as an error as we turn every deprecation into an exception and unfortunately it's a bit messy when the warning is issues at collection time. Also as it happens at collection time, none of our machinery is suitable to ignore these warnings when |
Can we not list the warning here? https://github.com/astropy/astropy/blob/master/astropy/tests/helper.py#L140 |
Hmm, I haven't tried that one yet, but the other two doesn't work (modules_to_ignore_on_import, or warnings_to_ignore_entire_module) |
I have a feeling it won't work either, as all of those happen consecutively in the same function. No harm trying though. |
What about using the |
@astrofrog - brilliant, it works!
|
Well... ignore my comments then. 😅 |
@pllim - that was my instinct, too thus haven't even tried it out yesterday along with the others 😄 |
I'm using the astropy package template and, yes, am affected by the bug. |
@bwinkel - I've just merged the ci-helpers PR that limits pytest to be <3.2, so affiliates should be fine for now. Nevertheless it's worth trying it locally and fix any issues that is triggered by the package itself. Once we worked out the issues in astropy core I'll send out an e-mail to astropy-dev and the affiliate maintainers mailing list about the workarounds affiliates can have. |
@bsipocz - Thanks!
Unfortunately, I have no idea what could go wrong in my .rst files. If I run the doctests individually on them, every single one of them seems to fail. I'm not sure if this is related to a warning (as expected), if I run python setup.py test -a -Wignore I still get the error messages (see below). The tests return with exit code 3 in both cases. INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/home/bwinkel/local/miniconda3/lib/python3.6/site-packages/_pytest/main.py", line 569, in location
INTERNALERROR> return self._location
INTERNALERROR> AttributeError: 'DocTestTextfilePlus' object has no attribute '_location'
INTERNALERROR>
INTERNALERROR> During handling of the above exception, another exception occurred:
INTERNALERROR>
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/home/bwinkel/local/miniconda3/lib/python3.6/site-packages/_pytest/main.py", line 110, in wrap_session
...
INTERNALERROR> nodeid=item.nodeid, location=item.location,
INTERNALERROR> File "/home/bwinkel/local/miniconda3/lib/python3.6/site-packages/_pytest/main.py", line 571, in location
INTERNALERROR> location = self.reportinfo()
INTERNALERROR> File "/home/bwinkel/local/miniconda3/lib/python3.6/site-packages/_pytest/doctest.py", line 143, in reportinfo
INTERNALERROR> return self.fspath, self.dtest.lineno, "[doctest] %s" % self.name
INTERNALERROR> AttributeError: 'NoneType' object has no attribute 'lineno' |
Is this happening locally? The quickest fix is to downgrade pytest to <3.2. I'll send out more info probably later today. |
I first encountered this on travis/appveyor, but I can reproduce it on my machine if is use pytest=3.2. |
@bsipocz, you did not change it for the appveyor script, did you? Sorry to bother you. |
It should be limited to <3.2 in appveyor, too. If you find it otherwise, could you post the link here? |
https://ci.appveyor.com/project/bwinkel/pycraf/build/job/wx6pf494meo6e358 It's strange; if you look at lines 54-65:
|
@bwinkel - Thanks, that indeed is an issue. I'll ping you once the fix is done. |
@bwinkel - try restarting now. |
@bsipocz - It works. Thanks a lot, I appreciate your help. |
@bsipocz Just confirming: the fix for this is still to use |
Yes, that's the quickest workaround. You don't see it on travis as However locally everything should be fine also if you have astropy dev. If you keep seeing issue that means that you package also have affected code. If that's the case, feel free to ping me on a GH issue that has the details. |
Test collection is failing when using the latest 3.2.0 pytest. Currently it's not yet picked up on either travis or appveyor, but is used on circleCI. Getting a solution is critical, and I'm looking into it now. Alternatively we could limit the pytest version until this is solved.
The text was updated successfully, but these errors were encountered: