Skip to content

Issue with Latest Version of Pytest #2

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

Open
s2t2 opened this issue Mar 7, 2019 · 4 comments
Open

Issue with Latest Version of Pytest #2

s2t2 opened this issue Mar 7, 2019 · 4 comments

Comments

@s2t2
Copy link
Owner

s2t2 commented Mar 7, 2019

# test/my_test.py

def my_first_test():
    assert True == True

Installing pytest:

pip install -U pytest
pytest --version

# This is pytest version 4.3.0, imported from /anaconda3/lib/python3.7/site-packages/pytest.py
# setuptools registered plugins:
#  pytest-remotedata-0.3.0 at /anaconda3/lib/python3.7/site-packages/pytest_remotedata/plugin.py
#  pytest-openfiles-0.3.0 at /anaconda3/lib/python3.7/site-packages/pytest_openfiles/plugin.py
#  pytest-doctestplus-0.1.3 at /anaconda3/lib/python3.7/site-packages/pytest_doctestplus/plugin.py
#  pytest-arraydiff-0.2 at /anaconda3/lib/python3.7/site-packages/pytest_arraydiff/plugin.py

running tests:

(my-env)  --->> pytest
======================================= test session starts ========================================
platform darwin -- Python 3.7.0, pytest-4.3.0, py-1.6.0, pluggy-0.7.1
rootdir: /Users/USERNAME/path/to/my-project, inifile:
plugins: remotedata-0.3.0, openfiles-0.3.0, doctestplus-0.1.3, arraydiff-0.2
collected 1 item                                                                                   

sample_test.py E                                                                             [100%]

============================================== ERRORS ==============================================
__________________________________ ERROR at setup of test_answer ___________________________________

item = <Function test_answer>

    def pytest_runtest_setup(item):
    
>       remote_data = item.get_marker('remote_data')
E       AttributeError: 'Function' object has no attribute 'get_marker'

/anaconda3/lib/python3.7/site-packages/pytest_remotedata/plugin.py:64: AttributeError
===================================== 1 error in 0.06 seconds ======================================
@s2t2
Copy link
Owner Author

s2t2 commented Mar 7, 2019

Although if installing differently, seems to work:

conda install -c anaconda pytest 

https://anaconda.org/anaconda/pytest

Might be an anaconda thing.

@blueyed
Copy link

blueyed commented Mar 8, 2019

A bug in "pytest-remotedata":

pytest_remotedata/plugin.py:64: AttributeError

Needs to be updated for new pytest API probably.

@nicoddemus
Copy link

Indeed: astropy/pytest-remotedata#37

@nicoddemus
Copy link

Actually seems to be fixed in 0.3.1.

raphaelvallat added a commit to raphaelvallat/pingouin that referenced this issue May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants