astropy: Test collecting errors with pytest 3.2.0

Test collection is failing when using the latest 3.2.0 pytest. Currently it’s not yet picked up on either travis or appveyor, but is used on circleCI. Getting a solution is critical, and I’m looking into it now. Alternatively we could limit the pytest version until this is solved.

============================= test session starts ==============================
platform linux2 -- Python 2.7.6, pytest-3.2.0, py-1.4.34, pluggy-0.4.0

Running tests with Astropy version 3.0.dev.
Running tests in lib.linux-i686-2.7/astropy docs.

Date: 2017-08-02T01:53:28

Platform: Linux-3.13.0-125-generic-i686-with-Ubuntu-14.04-trusty

Executable: /usr/bin/python

Full Python Version: 
2.7.6 (default, Oct 26 2016, 20:32:47) 
[GCC 4.8.4]

encodings: sys: ascii, locale: UTF-8, filesystem: UTF-8, unicode bits: 20
byteorder: little
float info: dig: 15, mant_dig: 15

Numpy: 1.12.1
Scipy: not available
Matplotlib: not available
h5py: not available
Pandas: not available
Cython: 0.25.2
Using Astropy options: remote_data: none.

rootdir: /tmp/astropy-test-lYT0mu, inifile: setup.cfg
collected 12700 items / 4 errors / 35 skipped

==================================== ERRORS ====================================
 ERROR collecting lib.linux-i686-2.7/astropy/coordinates/tests/test_finite_difference_velocities.py 
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/runner.py:191: in __init__
    self.result = func()
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/runner.py:370: in <lambda>
    lambda: list(collector.collect()),
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/python.py:389: in collect
    return super(Module, self).collect()
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/python.py:330: in collect
    res = self.makeitem(name, obj)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/python.py:342: in makeitem
    collector=self, name=name, obj=obj)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:250: in _wrapped_call
    wrap_controller.send(call_outcome)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/python.py:188: in pytest_pycollect_makeitem
    res = list(collector._genfunctions(name, obj))
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/python.py:362: in _genfunctions
    self.ihook.pytest_generate_tests(metafunc=metafunc)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:614: in execute
    res = hook_impl.function(*args)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/python.py:113: in pytest_generate_tests
    metafunc.parametrize(*marker.args, **marker.kwargs)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/python.py:781: in parametrize
    for x in argvalues]
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/mark.py:66: in extract_from
    warnings.warn(MARK_PARAMETERSET_UNPACKING)
E   RemovedInPytest4Warning: Applying marks directly to parameters is deprecated, please use pytest.param(..., marks=...) instead.
E   For more details, see: https://docs.pytest.org/en/latest/parametrize.html
_ ERROR collecting lib.linux-i686-2.7/astropy/io/ascii/tests/test_c_reader.py __
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/runner.py:191: in __init__
    self.result = func()
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/runner.py:370: in <lambda>
    lambda: list(collector.collect()),
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/python.py:389: in collect
    return super(Module, self).collect()
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/python.py:330: in collect
    res = self.makeitem(name, obj)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/python.py:342: in makeitem
    collector=self, name=name, obj=obj)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:250: in _wrapped_call
    wrap_controller.send(call_outcome)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/python.py:188: in pytest_pycollect_makeitem
    res = list(collector._genfunctions(name, obj))
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/python.py:362: in _genfunctions
    self.ihook.pytest_generate_tests(metafunc=metafunc)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:614: in execute
    res = hook_impl.function(*args)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/python.py:113: in pytest_generate_tests
    metafunc.parametrize(*marker.args, **marker.kwargs)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/python.py:781: in parametrize
    for x in argvalues]
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/mark.py:66: in extract_from
    warnings.warn(MARK_PARAMETERSET_UNPACKING)
E   RemovedInPytest4Warning: Applying marks directly to parameters is deprecated, please use pytest.param(..., marks=...) instead.
E   For more details, see: https://docs.pytest.org/en/latest/parametrize.html
_____ ERROR collecting lib.linux-i686-2.7/astropy/utils/tests/test_data.py _____
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/runner.py:191: in __init__
    self.result = func()
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/runner.py:370: in <lambda>
    lambda: list(collector.collect()),
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/python.py:389: in collect
    return super(Module, self).collect()
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/python.py:330: in collect
    res = self.makeitem(name, obj)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/python.py:342: in makeitem
    collector=self, name=name, obj=obj)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:250: in _wrapped_call
    wrap_controller.send(call_outcome)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/python.py:188: in pytest_pycollect_makeitem
    res = list(collector._genfunctions(name, obj))
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/python.py:362: in _genfunctions
    self.ihook.pytest_generate_tests(metafunc=metafunc)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:614: in execute
    res = hook_impl.function(*args)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/python.py:113: in pytest_generate_tests
    metafunc.parametrize(*marker.args, **marker.kwargs)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/python.py:781: in parametrize
    for x in argvalues]
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/mark.py:66: in extract_from
    warnings.warn(MARK_PARAMETERSET_UNPACKING)
E   RemovedInPytest4Warning: Applying marks directly to parameters is deprecated, please use pytest.param(..., marks=...) instead.
E   For more details, see: https://docs.pytest.org/en/latest/parametrize.html
_____ ERROR collecting lib.linux-i686-2.7/astropy/utils/tests/test_data.py _____
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/runner.py:191: in __init__
    self.result = func()
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/runner.py:370: in <lambda>
    lambda: list(collector.collect()),
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/python.py:389: in collect
    return super(Module, self).collect()
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/python.py:330: in collect
    res = self.makeitem(name, obj)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/python.py:342: in makeitem
    collector=self, name=name, obj=obj)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:250: in _wrapped_call
    wrap_controller.send(call_outcome)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/python.py:188: in pytest_pycollect_makeitem
    res = list(collector._genfunctions(name, obj))
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/python.py:362: in _genfunctions
    self.ihook.pytest_generate_tests(metafunc=metafunc)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/vendored_packages/pluggy.py:614: in execute
    res = hook_impl.function(*args)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/python.py:113: in pytest_generate_tests
    metafunc.parametrize(*marker.args, **marker.kwargs)
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/python.py:781: in parametrize
    for x in argvalues]
/usr/local/lib/python2.7/dist-packages/pytest-3.2.0-py2.7.egg/_pytest/mark.py:66: in extract_from
    warnings.warn(MARK_PARAMETERSET_UNPACKING)
E   RemovedInPytest4Warning: Applying marks directly to parameters is deprecated, please use pytest.param(..., marks=...) instead.
E   For more details, see: https://docs.pytest.org/en/latest/parametrize.html
=============================== warnings summary ===============================
None
  [pytest] section in setup.cfg files is deprecated, use [tool:pytest] instead.

-- Docs: http://doc.pytest.org/en/latest/warnings.html
!!!!!!!!!!!!!!!!!!! Interrupted: 4 errors during collection !!!!!!!!!!!!!!!!!!!!
=============== 35 skipped, 1 warnings, 4 error in 23.28 seconds ===============

./.run_docker_tests.sh returned exit code 2

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 32 (32 by maintainers)

Most upvoted comments

The solution seems to be trivial, PR is coming soon.

@pllim - that was my instinct, too thus haven’t even tried it out yesterday along with the others 😄

@astrofrog - brilliant, it works!

Executable: /Users/bsipocz/.virtualenvs/astropy-dev/bin/python

Full Python Version: 
3.5.3 (default, Apr 29 2017, 10:12:19) 
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)]

encodings: sys: utf-8, locale: UTF-8, filesystem: utf-8
byteorder: little
float info: dig: 15, mant_dig: 15

Numpy: 1.13.1
Scipy: 0.19.0
Matplotlib: 2.0.2
Pandas: 0.19.2
Astropy: 3.0.dev19709
scikit-image: 0.13.0
Using Astropy options: remote_data: none.

rootdir: /private/var/folders/dc/hsm7tqpx2d57n7vb3k1l81xw0000gq/T/photutils-test-5fbvy53e, inifile: setup.cfg
plugins: arraydiff-0.2.dev0, xdist-1.15.0, pep8-1.0.6, mpl-0.7, mock-1.6.0, cov-2.4.0, hypothesis-3.8.3
collected 1119 items 

photutils/aperture/bounding_box.py ..
photutils/aperture/tests/test_aperture_photometry.py .........................................s..............
photutils/aperture/tests/test_bounding_box.py ..........
photutils/background/core.py .........
photutils/background/tests/test_background_2d.py .......................
photutils/background/tests/test_core.py ......................
photutils/centroids/tests/test_core.py ........................
photutils/datasets/load.py .
photutils/datasets/make.py ....
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/sw/lib/python3.5/site-packages/_pytest/main.py", line 569, in location
INTERNALERROR>     return self._location
INTERNALERROR> AttributeError: 'DocTestTextfilePlus' object has no attribute '_location'
INTERNALERROR> 
INTERNALERROR> During handling of the above exception, another exception occurred:
INTERNALERROR> 
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/sw/lib/python3.5/site-packages/_pytest/main.py", line 110, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/sw/lib/python3.5/site-packages/_pytest/main.py", line 146, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/sw/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 745, in __call__
INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "/sw/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 339, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/sw/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 334, in <lambda>
INTERNALERROR>     _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR>   File "/sw/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 614, in execute
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/sw/lib/python3.5/site-packages/_pytest/main.py", line 169, in pytest_runtestloop
INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR>   File "/sw/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 745, in __call__
INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "/sw/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 339, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/sw/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 334, in <lambda>
INTERNALERROR>     _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR>   File "/sw/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 613, in execute
INTERNALERROR>     return _wrapped_call(hook_impl.function(*args), self.execute)
INTERNALERROR>   File "/sw/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 254, in _wrapped_call
INTERNALERROR>     return call_outcome.get_result()
INTERNALERROR>   File "/sw/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 279, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/sw/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 265, in __init__
INTERNALERROR>     self.result = func()
INTERNALERROR>   File "/sw/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 614, in execute
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/sw/lib/python3.5/site-packages/_pytest/runner.py", line 65, in pytest_runtest_protocol
INTERNALERROR>     nodeid=item.nodeid, location=item.location,
INTERNALERROR>   File "/sw/lib/python3.5/site-packages/_pytest/main.py", line 571, in location
INTERNALERROR>     location = self.reportinfo()
INTERNALERROR>   File "/sw/lib/python3.5/site-packages/_pytest/doctest.py", line 143, in reportinfo
INTERNALERROR>     return self.fspath, self.dtest.lineno, "[doctest] %s" % self.name
INTERNALERROR> AttributeError: 'NoneType' object has no attribute 'lineno'

============== 150 passed, 1 skipped, 1 warnings in 23.29 seconds ==============

photutils and astroquery are fine, but it may affect others, too. This actually only had a few month long deprecation period, and no warnings were issued before this error, so I’m not sure how we were supposed to notice it in time.