astropy / pytest-remotedata

Pytest plugin to control whether tests are run that have remote data
BSD 3-Clause "New" or "Revised" License
23 stars 15 forks source link

Pytest >= 4.1 throws AttributeError on all tests for pytest-remotedata #37

Closed rawrgulmuffins closed 5 years ago

rawrgulmuffins commented 5 years ago

Related thread from pytest-cov.

Specific error raised.

python -m pytest
======================================== test session starts =========================================
platform darwin -- Python 3.6.5, pytest-4.2.0, py-1.5.3, pluggy-0.8.1
benchmark: 3.2.2 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /Users/alexl/git/example, inifile: setup.cfg
plugins: remotedata-0.2.1, openfiles-0.3.0, doctestplus-0.1.3, cov-2.6.1, benchmark-3.2.2, arraydiff-0.2
collected 1 item

tests/test_example.py E                                                                        [100%]

=============================================== ERRORS ===============================================
___________________________ ERROR at setup of test_command_line_interface ____________________________

item = <Function test_command_line_interface>

    def pytest_runtest_setup(item):

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

/usr/local/anaconda3/lib/python3.6/site-packages/pytest_remotedata/plugin.py:59: AttributeError
====================================== 1 error in 0.11 seconds =======================================
make: *** [test] Error 1
astrofrog commented 5 years ago

It looks like you are using pytest-remotedata 0.2.1 - can you try the latest 0.3.1 release?

BaranOrnarli commented 5 years ago

0.3.0 fail (plain Anaconda3 install + conda install pytest) ; 0.3.1 success

StudyExchange commented 5 years ago

Env: Python 3.6.5 :: Anaconda, Inc. Install tool: pip My work version: pytest 5.0.0 pytest-arraydiff 0.2 pytest-astropy 0.3.0 pytest-doctestplus 0.1.3 pytest-openfiles 0.3.0 pytest-remotedata 0.3.1 python-dateutil 2.7.3

bsipocz commented 5 years ago

I believe this has been since fixed, but feel free to reopen if this is not true.