Repository navigation
Closed
Description
I got errors on all the systems I tested when testing with the option unrelated to remote_data=Trueremote_data
========================================================================================= ERRORS =========================================================================================
_________________________________________________________________ ERROR collecting astropy/modeling/tests/test_models.py _________________________________________________________________
_pytest.runner:137: in __init__
> ???
_pytest.main:418: in _memocollect
> ???
_pytest.main:295: in _memoizedcall
> ???
_pytest.main:418: in <lambda>
> ???
_pytest.python:527: in collect
> ???
_pytest.python:321: in collect
> ???
_pytest.python:333: in makeitem
> ???
_pytest.main:161: in call_matching_hooks
> ???
_pytest.core:380: in pcall
> ???
_pytest.core:387: in _docall
> ???
_pytest.core:288: in execute
> ???
_pytest.python:227: in pytest_pycollect_makeitem
> ???
_pytest.python:349: in _genfunctions
> ???
_pytest.core:380: in pcall
> ???
_pytest.core:387: in _docall
> ???
_pytest.core:288: in execute
> ???
_pytest.python:145: in pytest_generate_tests
> ???
_pytest.python:817: in parametrize
> ???
_pytest.python:698: in setmulti
> ???
_pytest.python:681: in _checkargnotcontained
> ???
E ValueError: duplicate u'model_class'
_________________________________________________________________ ERROR collecting astropy/modeling/tests/test_models.py _________________________________________________________________
_pytest.runner:137: in __init__
> ???
_pytest.main:418: in _memocollect
> ???
_pytest.main:295: in _memoizedcall
> ???
_pytest.main:418: in <lambda>
> ???
_pytest.python:527: in collect
> ???
_pytest.python:321: in collect
> ???
_pytest.python:333: in makeitem
> ???
_pytest.main:161: in call_matching_hooks
> ???
_pytest.core:380: in pcall
> ???
_pytest.core:387: in _docall
> ???
_pytest.core:288: in execute
> ???
_pytest.python:227: in pytest_pycollect_makeitem
> ???
_pytest.python:349: in _genfunctions
> ???
_pytest.core:380: in pcall
> ???
_pytest.core:387: in _docall
> ???
_pytest.core:288: in execute
> ???
_pytest.python:145: in pytest_generate_tests
> ???
_pytest.python:817: in parametrize
> ???
_pytest.python:698: in setmulti
> ???
_pytest.python:681: in _checkargnotcontained
> ???
E ValueError: duplicate u'model_class'
One of the full logs: https://gist.github.com/bsipocz/7880e511664a5c30abd1
Activity
bsipocz commentedon Feb 12, 2015
This must be something trivial, and not related to
remote_data, as it only happens for a laterastropy.test()call, but never for the first one from the given interpreter.[-]v1.0rc2 remote_data testing errors in modeling[/-][+]v1.0rc2 testing errors in modeling during second test run[/+]embray commentedon Feb 13, 2015
Yeah there's nothing in there that would have to do with
remote_data. The other failures maybe, but that's part of why remote_data is disabled by default. That's bizarre though--it looks like it has more to do with py.test than anything else. I'll see if I can reproduce.If I understand correctly, this is just from running
astropy.test()twice in the same session?bsipocz commentedon Feb 13, 2015
@embray - yes, it's running
astropy.test()twice. The other failuresare due to the error, and I got no extra failures even for
remote_datawhen run it first in a session.
On 13 February 2015 at 17:24, Erik Bray [email protected] wrote:
astrofrog commentedon Feb 14, 2015
I can confirm the issue with:
weird!
astrofrog commentedon Feb 14, 2015
Hmm for some reason- unrelated, removing this between the two test runs changes nothingpytestis writing a__pycache__directory toastropy/modelingwhen running the tests (but should be writing to a temporary directory)astrofrog commentedon Feb 14, 2015
Minimal failing example:
Put following in
test_double.pyRun with
py.test test_double.py test_double.pyGives:
astrofrog commentedon Feb 14, 2015
So the issue is in
test_models.pywith the following code:and is related to decorating the classes.
Reported with
pytesthere:https://bitbucket.org/hpk42/pytest/issue/683/bug-with-parameterized-classes-when
In the mean time, a workaround is to decorate the methods instead of the class, but the issue is that the two classes need different parameters.
In any case, not critical for 1.0 so we don't have to fix it before the final release.
embray commentedon Feb 16, 2015
If the issue is indeed with py.test it must be a regression, since I hadn't seen this happen before even under this context.
embray commentedon Feb 16, 2015
Huh...well, I tested this back to py.test v.2.4.2 and still had this problem so maybe it isn't new. Wonder why it never came up before. Maybe that test just didn't exist last time I was testing multiple subsequent test runs.
embray commentedon Feb 16, 2015
I tried coming up with a workaround to this, but it's even trickier than I thought. Might be possible to just monkey-patch the
transfer_markersfunction that I identified as the problem. But might not even be worth the effort :)astrofrog commentedon Feb 16, 2015
I don't think this is 1.0-critical. Honestly I think running tests twice is a rare use case and we could just list it in the known issues if we really care.
bsipocz commentedon Nov 25, 2015
Oops, run into this again with 1.1rc1 testing :)
The difference that now there are some additional fails on top of the errors.
Will rerun everything tomorrow, and refresh the table.
astrofrog commentedon Nov 25, 2015
Huh, the py.test bug report link is gone. Checking.
astrofrog commentedon Nov 25, 2015
Looks like it moved here:
pytest-dev/pytest#683
and got fixed in py.test here:
pytest-dev/pytest@e8f4819
The bundled py.test is 2.5.1. We need to update the bundled version to 2.8.0 or later. I'm on it.
astrofrog commentedon Nov 25, 2015
See #4349
eteq commentedon Feb 12, 2016
I think this is fixed by #4349, so closing. But if it turns out not to fix it, feel free to re-open!