Skip to content
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

Failing test_alias and TestAliasRead.test_alias_read #5076

Closed
je-miralles opened this issue Jun 11, 2016 · 9 comments
Closed

Failing test_alias and TestAliasRead.test_alias_read #5076

je-miralles opened this issue Jun 11, 2016 · 9 comments

Comments

@je-miralles
Copy link

Two tests failing with the same error on Astropy 1.2rc1, Python 3.5.1 (conda), OS X 10.10.

===== test session starts ====================
platform darwin -- Python 3.5.1, pytest-2.8.3, py-1.4.30, pluggy-0.3.1
Platform: Darwin-14.5.0-x86_64-i386-64bit
Full Python Version:
3.5.1 |Anaconda 4.0.0 (x86_64)| (default, Dec 7 2015, 11:24:55)
[GCC 4.2.1 (Apple Inc. build 5577)]
encodings: sys: utf-8, locale: UTF-8, filesystem: utf-8
byteorder: little
float info: dig: 15, mant_dig: 15
Numpy: 1.10.4
Scipy: 0.17.0
Matplotlib: 1.5.1
h5py: 2.5.0
Pandas: 0.18.0
Using Astropy options: remote_data.
_____ test_alias _______________________________

def test_alias():
    from ...cosmology import core, WMAP9, WMAP7

    # REMOVE in astropy 0.5

    with catch_warnings() as w:
      x = core.DEFAULT_COSMOLOGY()

E AttributeError: module 'astropy.cosmology.core' has no attribute 'DEFAULT_COSMOLOGY'

../anaconda/envs/ENV/lib/python3.5/site-packages/astropy/utils/tests/test_state.py:15: AttributeError
______ TestAliasRead.test_alias_read _____________________________

self = <astropy.utils.tests.test_state.TestAliasRead object at 0x1278c3b38>

def test_alias_read(self):
    from ...cosmology import core, WMAP9, WMAP7

    with catch_warnings() as w:
      core.DEFAULT_COSMOLOGY.reload()

E AttributeError: module 'astropy.cosmology.core' has no attribute 'DEFAULT_COSMOLOGY'

../anaconda/envs/ENV/lib/python3.5/site-packages/astropy/utils/tests/test_state.py:59: AttributeError
===== 2 failed, 8230 passed, 64 skipped, 38 xfailed in 959.94 seconds =========

@je-miralles
Copy link
Author

On a fresh conda environment I don't get these errors.
It seems astropy/utils/tests/test_state.py has been removed. Could it have been left behind from a previous install? are old files not expected to be cleaned out?

@astrofrog
Copy link
Member

This file was indeed removed. How did you install the RC? (normally, I thought files that no longer exist should be removed by the installer)

@bsipocz
Copy link
Member

bsipocz commented Jun 12, 2016

I see the same errors on an ubuntu 14.04 after a standard pip install:
pip install --upgrade --pre --user --no-deps astropy

Previously installed version was 1.1.2

@astrofrog
Copy link
Member

Interesting - I wonder if this is a pip bug? Presumably pip uninstall astropy then installing again works?

@bsipocz
Copy link
Member

bsipocz commented Jun 12, 2016

@astrofrog - you seem to be right with the pip issue. Trying to uninstall I get this Can't uninstall 'astropy'. No files were found to uninstall., however it still nicely imports and works.
Looking at the versions it seems that I'm using the system installed pip with an ancient version of 1.5.4.

@bsipocz
Copy link
Member

bsipocz commented Jun 12, 2016

So I can confirm that after (a pip upgrade and) an uninstall and install of astropy these failures go away.

@je-miralles
Copy link
Author

I was originally on pip-8.1.2 with astropy-1.1.2 and did pip install astropy==1.2rc2 when I got the failures.

I tried uninstalling and re-installing :
pip uninstall astropy
pip install astropy==1.2rc1

Requirement already satisfied (use --upgrade to upgrade): astropy==1.2rc1 in /Users/juanemiliomiralles/anaconda/envs/ENV/lib/python3.5/site-packages

Requirement already satisfied (use --upgrade to upgrade): numpy>=1.7.0 in /Users/juanemiliomiralles/anaconda/envs/ENV/lib/python3.5/site-packages (from astropy==1.2rc1)

$ python -c "import astropy; astropy.test(remote_data=True)"
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: module 'astropy' has no attribute 'test'

but after pip uninstall astropy==1.2rc1 && pip install astropy==1.2rc1 things are working properly with no failures.

@pllim pllim added this to the v1.2.0 milestone Jun 13, 2016
@pllim
Copy link
Member

pllim commented Jun 13, 2016

Can we close this then?

@bsipocz
Copy link
Member

bsipocz commented Jun 13, 2016

I think yes, though tagging it as an upstream issue may be useful.

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

No branches or pull requests

4 participants