napari / napari-animation

A napari plugin for making animations
https://napari.github.io/napari-animation/
Other
74 stars 27 forks source link

Tox test collection is failing #201

Closed GenevieveBuckley closed 5 months ago

GenevieveBuckley commented 5 months ago

The tox test collection is failing and producing errors. Strangely, running pytest directly does not produce the same test collection errors.

Here is an example of the CI testing failing on the main branch: I can reproduce this locally on my machine.

  ==================================== ERRORS ====================================
  ___________________ ERROR collecting napari_animation/_tests ___________________
  .tox/py311-linux-pyqt/lib/python3.11/site-packages/_pytest/config/__init__.py:654: in _importconftest
      mod = import_path(conftestpath, mode=importmode, root=rootpath)
  .tox/py311-linux-pyqt/lib/python3.11/site-packages/_pytest/pathlib.py:590: in import_path
      raise ImportPathMismatchError(module_name, module_file, path)
  E   _pytest.pathlib.ImportPathMismatchError: ('napari_animation._tests.conftest', '/home/runner/work/napari-animation/napari-animation/.tox/py311-linux-pyqt/lib/python3.11/site-packages/napari_animation/_tests/conftest.py', PosixPath('/home/runner/work/napari-animation/napari-animation/napari_animation/_tests/conftest.py'))

  ---------- coverage: platform linux, python 3.11.7-final-0 -----------
  Coverage XML written to file coverage.xml

  !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
  Results (3.78s):
           1 error
  py311-linux-pyqt: exit 2 (5.88 seconds) /home/runner/work/napari-animation/napari-animation> pytest -v --color=yes --cov=napari_animation --cov-report=xml pid=3993
.pkg: _exit> python /opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta
  py311-linux-pyqt: FAIL code 2 (143.66=setup[137.79]+cmd[5.88] seconds)
  evaluation failed :( (143.79 seconds)
Error: The process '/opt/hostedtoolcache/Python/3.11.7/x64/bin/tox' failed with exit code 2
The process '/opt/hostedtoolcache/Python/3.11.7/x64/bin/tox' failed with exit code 2
psobolewskiPhD commented 5 months ago

Just for future reference, I suspect the reason this popped up suddenly is release of 8.0 pytest. It has breaking changes to test collection: https://pytest.org/en/latest/changelog.html#collection-changes