spulec / freezegun

Let your Python tests travel through time
Apache License 2.0
4.2k stars 269 forks source link

1.1.0: pytest is failing with new setuptools #435

Open kloczek opened 2 years ago

kloczek commented 2 years ago

Here is the example on testing pydantic

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pydantic-1.8.2-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pydantic-1.8.2-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra --deselect tests/test_utils.py::test_version_strict
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/pydantic-1.8.2, configfile: setup.cfg, testpaths: tests
plugins: flaky-3.7.0, freezegun-0.4.2, mock-3.6.1, timeout-2.0.2, subtests-0.5.0
collected 2067 items
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/_pytest/main.py", line 269, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/_pytest/main.py", line 322, in _main
INTERNALERROR>     config.hook.pytest_collection(session=session)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_hooks.py", line 265, in __call__
INTERNALERROR>     return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/_pytest/main.py", line 333, in pytest_collection
INTERNALERROR>     session.perform_collect()
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/_pytest/main.py", line 637, in perform_collect
INTERNALERROR>     hook.pytest_collection_modifyitems(
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_hooks.py", line 265, in __call__
INTERNALERROR>     return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pytest_freezegun.py", line 55, in pytest_collection_modifyitems
INTERNALERROR>     if get_closest_marker(item, MARKER_NAME):
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pytest_freezegun.py", line 17, in get_closest_marker
INTERNALERROR>     if LooseVersion(pytest.__version__) < LooseVersion('3.6.0'):
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/setuptools/_distutils/version.py", line 53, in __init__
INTERNALERROR>     warnings.warn(
INTERNALERROR> DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.

========================================================================== no tests ran in 3.06s ===========================================================================
kloczek commented 2 years ago

This issue affects as well https://github.com/mrbean-bremen/pytest-find-dependencies/issues/2