jaraco / tempora

MIT License
20 stars 7 forks source link

5.5.1: drop use of `pytest-freezgun` #28

Closed kloczek closed 4 months ago

kloczek commented 5 months ago

pyetst-freezgun is abandoned project and not been maintained for more than 4 years. https://github.com/ktosiek/pytest-freezegun/ freezgun still is well maintained.

pytest fails without that pytest extension which provides fixture

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-tempora-5.5.1-2.fc37.x86_64/usr/lib64/python3.10/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-tempora-5.5.1-2.fc37.x86_64/usr/lib/python3.10/site-packages
+ /usr/bin/pytest -ra -m 'not network'
============================= test session starts ==============================
platform linux -- Python 3.10.14, pytest-8.1.1, pluggy-1.4.0
rootdir: /home/tkloczko/rpmbuild/BUILD/tempora-5.5.1
configfile: pytest.ini
collected 42 items

tempora/__init__.py .......F....                                         [ 28%]
tempora/schedule.py ...                                                  [ 35%]
tempora/timing.py .....                                                  [ 47%]
tempora/utc.py .                                                         [ 50%]
tests/test_schedule.py ...................                               [ 95%]
tests/test_timing.py ..                                                  [100%]

=================================== FAILURES ===================================
__________________ [doctest] tempora.get_nearest_year_for_day __________________
211
212     Returns the nearest year to now inferred from a Julian date.
213
214     >>> freezer = getfixture('freezer')
UNEXPECTED EXCEPTION: FixtureLookupError('freezer', <FixtureRequest for <DoctestItem tempora.get_nearest_year_for_day>>)
Traceback (most recent call last):
  File "/usr/lib64/python3.10/doctest.py", line 1350, in __run
    exec(compile(example.source, filename, "single",
  File "<doctest tempora.get_nearest_year_for_day[0]>", line 1, in <module>
  File "/usr/lib/python3.10/site-packages/_pytest/fixtures.py", line 541, in getfixturevalue
    fixturedef = self._get_active_fixturedef(argname)
  File "/usr/lib/python3.10/site-packages/_pytest/fixtures.py", line 564, in _get_active_fixturedef
    fixturedef = self._getnextfixturedef(argname)
  File "/usr/lib/python3.10/site-packages/_pytest/fixtures.py", line 415, in _getnextfixturedef
    raise FixtureLookupError(argname, self)
_pytest.fixtures.FixtureLookupError: ('freezer', <FixtureRequest for <DoctestItem tempora.get_nearest_year_for_day>>)
/home/tkloczko/rpmbuild/BUILD/tempora-5.5.1/tempora/__init__.py:214: UnexpectedException
=========================== short test summary info ============================
FAILED tempora/__init__.py::tempora.get_nearest_year_for_day
========================= 1 failed, 41 passed in 1.44s =========================
jaraco commented 5 months ago

In 881dc44, the dependency on pytest-freezegun was replaced with pytest-freezer. You'll want to install that as declared by the test dependencies.

kloczek commented 4 months ago

Is it possible to release new version with that change? 🤔

jaraco commented 4 months ago

According to the tags, that commit was first released in 5.3.0. If you're finding that the change isn't present in your copy, please trace that back to the artifacts in PyPI. If you find there's a problem with the artifacts in PyPI (or elsewhere), please direct me to that problem.