You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
'Config' object has no attribute '_conftest' #4607
Following on #4256 (comment) and #4349, I'm still seeing issues with conftest. I can reproduce this on one of my own computers, but not another. The error:
==================================== ERRORS ====================================
_____ ERROR collecting lib.linux-x86_64-2.7/image_registration/conftest.py _____
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/tests/pytest_plugins.py:120: in collect
module = self.config._conftest.importconftest(self.fspath)
E AttributeError: 'Config' object has no attribute '_conftest'
==================== 9458 passed, 1 error in 31.27 seconds =====================
@keflavich - are you using the latest master? I don't see that line on line 120 of pytest_plugins.py, so I'm wondering if somehow you are still using an old astropy version?
@keflavich - the setup.py file is very different to the package template, and uses runtests.py to run the tests rather than the command provided by the astropy-helpers. I think you aren't using astropy-helpers at all?
@keflavich - somehow it's using a recent version of pytest, not the version bundled with astropy 1.0.4. Try removing pytest from CONDA_DEPENDENCIES. You'll likely need to update any imports of import pytest to from astropy.tests.helper import pytest
aha, that's probably it! Thanks @astrofrog - I'll close this if it fixes the issue. That also (kind of) explains why I can reproduce the problem on some but not all machines.
@keflavich - not sure, but it shouldn't matter in the end, if you always use the bundled one internally in your package (the installed pytest shouldn't be getting used)
@astrofrog - the issue is resolved by doing from astropy.tests.helper import pytest instead of import pytest: keflavich/image_registration#8
now the remaining failures on that issue are just normal python3 migration bugs.
Activity
astrofrog commentedon Feb 13, 2016
@keflavich - are you using the latest master? I don't see that line on line 120 of
pytest_plugins.py, so I'm wondering if somehow you are still using an old astropy version?keflavich commentedon Feb 13, 2016
...strange, this is happening on .travis. Maybe the wrong version is being installed?
astrofrog commentedon Feb 13, 2016
In the header, it says
Running tests with Astropy version 1.0.4.astrofrog commentedon Feb 13, 2016
And I suspect your
runtests.pyscript was generated from a recent py.testastrofrog commentedon Feb 13, 2016
@keflavich - why not use the normal
python setup.py testmechanism for affiliated packages which uses the bundled py.test from astropy?keflavich commentedon Feb 13, 2016
....am I not? that's not intentional; I thought I had copied that from package-template
astrofrog commentedon Feb 13, 2016
@keflavich - the setup.py file is very different to the package template, and uses
runtests.pyto run the tests rather than the command provided by the astropy-helpers. I think you aren't using astropy-helpers at all?keflavich commentedon Feb 13, 2016
are you looking at the py3 branch?
astrofrog commentedon Feb 13, 2016
Ah no sorry. Will look again at that branch later.
astrofrog commentedon Feb 14, 2016
@keflavich - somehow it's using a recent version of pytest, not the version bundled with astropy 1.0.4. Try removing
pytestfromCONDA_DEPENDENCIES. You'll likely need to update any imports ofimport pytesttofrom astropy.tests.helper import pytestkeflavich commentedon Feb 14, 2016
aha, that's probably it! Thanks @astrofrog - I'll close this if it fixes the issue. That also (kind of) explains why I can reproduce the problem on some but not all machines.
keflavich commentedon Feb 14, 2016
This is the version being used:
https://travis-ci.org/keflavich/image_registration/jobs/109145825#L489
it looks like it is a too-recent version, but I don't know why.
astrofrog commentedon Feb 14, 2016
@keflavich - not sure, but it shouldn't matter in the end, if you always use the bundled one internally in your package (the installed pytest shouldn't be getting used)
keflavich commentedon Feb 14, 2016
@astrofrog ok - any ideas why
python setup.py testis not using the bundled internal variant?astrofrog commentedon Feb 14, 2016
@keflavich - I'll look into it :)
astrofrog commentedon Feb 14, 2016
@keflavich - I can't reproduce the issue locally... very strange!
keflavich commentedon Feb 14, 2016
@astrofrog - the issue is resolved by doing
from astropy.tests.helper import pytestinstead ofimport pytest:keflavich/image_registration#8
now the remaining failures on that issue are just normal python3 migration bugs.
bsipocz commentedon Mar 28, 2017
Is that right that this makes any testing that uses LTS incompatible with pytest3?
E.g. for astroquery we need pytest3 to get the python3.6 builds pass (due to a pytest/unittest issue mentioned in #5917): https://travis-ci.org/astropy/astroquery/jobs/216084609