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

any hints on errors during collecting the tests? #25197

Closed
yarikoptic opened this issue Feb 6, 2019 · 9 comments
Closed

any hints on errors during collecting the tests? #25197

yarikoptic opened this issue Feb 6, 2019 · 9 comments
Labels
Bug Linux Linux OS Testing pandas testing functions or related to the test suite

Comments

@yarikoptic
Copy link
Contributor

While updating debian package for pandas 0.24.1 running into this odd error with pytest during collection. Just wondered if someone might have an immediate clue so I don't waste too much time trying to catch the ghost (pytest pkg is 3.10.1-2):

collected 47434 items / 2 errors / 778 deselected / 3 skipped                                                     

===================================================== ERRORS ======================================================
_____________________________ ERROR collecting tests/indexes/datetimes/test_tools.py ______________________________
/usr/lib/python2.7/dist-packages/pluggy/hooks.py:284: in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
/usr/lib/python2.7/dist-packages/pluggy/manager.py:67: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
/usr/lib/python2.7/dist-packages/pluggy/manager.py:61: in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
/usr/lib/python2.7/dist-packages/_pytest/python.py:224: in pytest_pycollect_makeitem
    res = list(collector._genfunctions(name, obj))
/usr/lib/python2.7/dist-packages/_pytest/python.py:409: in _genfunctions
    self.ihook.pytest_generate_tests(metafunc=metafunc)
/usr/lib/python2.7/dist-packages/pluggy/hooks.py:284: in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
/usr/lib/python2.7/dist-packages/pluggy/manager.py:67: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
/usr/lib/python2.7/dist-packages/pluggy/manager.py:61: in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
/usr/lib/python2.7/dist-packages/_pytest/python.py:133: in pytest_generate_tests
    metafunc.parametrize(*marker.args, **marker.kwargs)
/usr/lib/python2.7/dist-packages/_pytest/python.py:973: in parametrize
    param_index,
/usr/lib/python2.7/dist-packages/_pytest/python.py:841: in setmulti2
    self._checkargnotcontained(arg)
/usr/lib/python2.7/dist-packages/_pytest/python.py:825: in _checkargnotcontained
    raise ValueError("duplicate %r" % (arg,))
E   ValueError: duplicate 'box'
__________________________________ ERROR collecting tests/resample/test_base.py ___________________________________
In test_resample_empty_dataframe_all_ts: function uses no argument '_index_factory'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=============================== 3 skipped, 778 deselected, 2 error in 37.76 seconds ===============================
All of it with versions etc (click to expand)
echo "backend : Agg" >| /build/pandas-0.24.1/build/matplotlibrc
: # Run unittests here against installed pandas
echo "2.7" | grep -q '^3' && PY=3 || PY=2.7; \
export PYTHONPATH=`/bin/ls -d $PWD/debian/tmp/usr/lib/python$PY/*/`; \
export MPLCONFIGDIR=/build/pandas-0.24.1/build HOME=/build/pandas-0.24.1/build; \
cd build/; \
python2.7 -c 'import pandas as pd; pd.show_versions()'; \
        LOCALE_OVERRIDE=C xvfb-run -a -s "-screen 0 1280x1024x24 -noreset" \
        python2.7 -m pytest -s -v -m "not single and not network and not disabled "    $PYTHONPATH/pandas;

INSTALLED VERSIONS
------------------
commit: None
python: 2.7.15.final.0
python-bits: 64
OS: Linux
OS-release: 4.18.0-0.bpo.1-amd64
machine: x86_64
processor: 
byteorder: little
LC_ALL: C
LANG: C
LOCALE: None.None

pandas: 0.24.1
pytest: 3.10.1
pip: None
setuptools: 40.7.1
Cython: 0.29.2
numpy: 1.16.1
scipy: 1.1.0
pyarrow: None
xarray: None
IPython: 5.8.0
sphinx: 1.8.3
patsy: None
dateutil: 2.7.3
pytz: 2018.9
blosc: None
bottleneck: None
tables: 3.4.4
numexpr: 2.6.9
feather: None
matplotlib: 2.2.3
openpyxl: 2.4.9
xlrd: 1.1.0
xlwt: 1.3.0
xlsxwriter: 1.1.2
lxml.etree: 4.3.0
bs4: 4.7.1
html5lib: 1.0.1
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
gcsfs: None
=============================================== test session starts ===============================================
platform linux2 -- Python 2.7.15+, pytest-3.10.1, py-1.7.0, pluggy-0.8.0 -- /usr/bin/python2.7
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/build/pandas-0.24.1/build/.hypothesis/examples')
rootdir: /tmp/buildd/pandas-0.24.1, inifile: setup.cfg
plugins: hypothesis-3.71.11
collected 47434 items / 2 errors / 778 deselected / 3 skipped                                                     

===================================================== ERRORS ======================================================
_____________________________ ERROR collecting tests/indexes/datetimes/test_tools.py ______________________________
/usr/lib/python2.7/dist-packages/pluggy/hooks.py:284: in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
/usr/lib/python2.7/dist-packages/pluggy/manager.py:67: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
/usr/lib/python2.7/dist-packages/pluggy/manager.py:61: in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
/usr/lib/python2.7/dist-packages/_pytest/python.py:224: in pytest_pycollect_makeitem
    res = list(collector._genfunctions(name, obj))
/usr/lib/python2.7/dist-packages/_pytest/python.py:409: in _genfunctions
    self.ihook.pytest_generate_tests(metafunc=metafunc)
/usr/lib/python2.7/dist-packages/pluggy/hooks.py:284: in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
/usr/lib/python2.7/dist-packages/pluggy/manager.py:67: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
/usr/lib/python2.7/dist-packages/pluggy/manager.py:61: in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
/usr/lib/python2.7/dist-packages/_pytest/python.py:133: in pytest_generate_tests
    metafunc.parametrize(*marker.args, **marker.kwargs)
/usr/lib/python2.7/dist-packages/_pytest/python.py:973: in parametrize
    param_index,
/usr/lib/python2.7/dist-packages/_pytest/python.py:841: in setmulti2
    self._checkargnotcontained(arg)
/usr/lib/python2.7/dist-packages/_pytest/python.py:825: in _checkargnotcontained
    raise ValueError("duplicate %r" % (arg,))
E   ValueError: duplicate 'box'
__________________________________ ERROR collecting tests/resample/test_base.py ___________________________________
In test_resample_empty_dataframe_all_ts: function uses no argument '_index_factory'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=============================== 3 skipped, 778 deselected, 2 error in 37.76 seconds ===============================
XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":99"
      after 11 requests (8 known processed) with 0 events remaining.
make[1]: *** [debian/rules:128: python-test2.7] Error 2
make[1]: Leaving directory '/build/pandas-0.24.1'
make: *** [debian/rules:67: binary] Error 2
@jschendel
Copy link
Member

The environment.yml and requirements-dev.txt files have the minimum version of pytest listed a 4.0. Can you upgrade pytest and see if the errors are still present?

- pytest>=4.0

pytest>=4.0

@yarikoptic
Copy link
Contributor Author

Oh, that would be a bummer... We have only 3.10.1 in Debian unstable
https://packages.debian.org/sid/python-pytest and even older ones (3.x) available in other releases of Debian add Ubuntu... That would preclude testing on those platforms. I guess I will need to check if there is anything easy way to regain compatibility with older versions of that is the case (will update via pip later today to see if that is the reason)

@yarikoptic
Copy link
Contributor Author

Heh, it seems that the boost to require 4.x was just to assist conda in solving dependencies
5b0610b
ie there were no functional reason at that point (knowing which could have helped me now)

@yarikoptic
Copy link
Contributor Author

with upgrade of pytest via pip situation improves 50% -- one error is gone but not the other:

=============================================== test session starts ===============================================
platform linux2 -- Python 2.7.15+, pytest-4.2.0, py-1.7.0, pluggy-0.8.0 -- /usr/bin/python2.7
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/build/pandas-0.24.1/build/.hypothesis/examples')
rootdir: /tmp/buildd/pandas-0.24.1, inifile: setup.cfg
plugins: hypothesis-3.71.11
collected 47466 items / 1 errors / 777 deselected / 3 skipped / 46685 selected                                    

===================================================== ERRORS ======================================================
__________________________________ ERROR collecting tests/resample/test_base.py ___________________________________
In test_resample_empty_dataframe_all_ts: function uses no argument '_index_factory'
============================================ deprecated python version ============================================
You are using Python 2.7.15, which will no longer be supported in pytest 5.0
For more information, please read:
  https://docs.pytest.org/en/latest/py27-py34-deprecation.html
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=============================== 3 skipped, 777 deselected, 1 error in 23.28 seconds =================

@jschendel
Copy link
Member

cc @simonjayhawkins : any ideas on what could be causing this?

@jschendel jschendel added the Testing pandas testing functions or related to the test suite label Feb 7, 2019
@simonjayhawkins
Copy link
Member

will take a look a bit later, but just off the top of my head for now:

the tests in tests/resample/test_base.py uses a pytest_generate_tests hook.

last time i looked this was the only use of that hook in the codebase, so that does not rule out the possibility that it could be a pytest issue.

the hook applies indirect parametrisation to any test in that module with a name ending in _all_ts.

@yarikoptic
Copy link
Contributor Author

uff -- pytest magic in all the fixtures setup/handling. As much I like assert statements introspection, as much I dislike the magics of pytest - tests quickly become not straight Python. Thanks in advance @simonjayhawkins ! If really needed, can provide a full recipe to reproduce using e.g. Dockerfile recipe

@simonjayhawkins
Copy link
Member

@yarikoptic just had a quick look to refresh memory. seems weird that test_resample_empty_dataframe_all_ts is causing a problem since 'test_resample_empty_series_all_ts` just before it is effectively using the same fixtures, so i would expect it to fail there is there was an issue with pytest and/or dependencies.

at the time i added the pytest_generate_tests, i was not totally happy using the test name to determine the parametrisation, but was trying to faithfully replicate the existing class based test. as a parallel activity i'll have a rethink of this strategy anyway.

@jreback
Copy link
Contributor

jreback commented Feb 11, 2019

merged #25262, see if this helps you (note I merged to 0.25, but trivial to backport if it helps)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Linux Linux OS Testing pandas testing functions or related to the test suite
Projects
None yet
Development

No branches or pull requests

6 participants