Skip to content

'Config' object has no attribute '_conftest' #4607

Closed

Description

@keflavich

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 =====================

Activity

  1. astrofrog commented on Feb 13, 2016

    @astrofrog
    Member

    @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?

  2. keflavich commented on Feb 13, 2016

    @keflavich
    ContributorAuthor

    ...strange, this is happening on .travis. Maybe the wrong version is being installed?

  3. astrofrog commented on Feb 13, 2016

    @astrofrog
    Member

    In the header, it says Running tests with Astropy version 1.0.4.

  4. astrofrog commented on Feb 13, 2016

    @astrofrog
    Member

    And I suspect your runtests.py script was generated from a recent py.test

  5. astrofrog commented on Feb 13, 2016

    @astrofrog
    Member

    @keflavich - why not use the normal python setup.py test mechanism for affiliated packages which uses the bundled py.test from astropy?

  6. keflavich commented on Feb 13, 2016

    @keflavich
    ContributorAuthor

    ....am I not? that's not intentional; I thought I had copied that from package-template

  7. astrofrog commented on Feb 13, 2016

    @astrofrog
    Member

    @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?

  8. keflavich commented on Feb 13, 2016

    @keflavich
    ContributorAuthor

    are you looking at the py3 branch?

  9. astrofrog commented on Feb 13, 2016

    @astrofrog
    Member

    Ah no sorry. Will look again at that branch later.

  10. astrofrog commented on Feb 14, 2016

    @astrofrog
    Member

    @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

  11. keflavich commented on Feb 14, 2016

    @keflavich
    ContributorAuthor

    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.

  12. keflavich commented on Feb 14, 2016

    @keflavich
    ContributorAuthor

    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.

  13. astrofrog commented on Feb 14, 2016

    @astrofrog
    Member

    @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)

  14. keflavich commented on Feb 14, 2016

    @keflavich
    ContributorAuthor

    @astrofrog ok - any ideas why python setup.py test is not using the bundled internal variant?

  15. astrofrog commented on Feb 14, 2016

    @astrofrog
    Member

    @keflavich - I'll look into it :)

  16. astrofrog commented on Feb 14, 2016

    @astrofrog
    Member

    @keflavich - I can't reproduce the issue locally... very strange!

  17. keflavich commented on Feb 14, 2016

    @keflavich
    ContributorAuthor

    @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.

  18. bsipocz commented on Mar 28, 2017

    @bsipocz
    Member

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions