# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= python-freezegun VERSION= 1.5.1 KEYWORDS= python VARIANTS= v12 v13 SDESC[v12]= Let your Python tests travel through time (3.12) SDESC[v13]= Let your Python tests travel through time (3.13) HOMEPAGE= https://github.com/spulec/freezegun CONTACT= Python_Automaton[python@ironwolf.systems] DOWNLOAD_GROUPS= main SITES[main]= PYPIWHL/51/0b/0d7fee5919bccc1fdc1c2a7528b98f65c6f69b223a3fd8f809918c142c36 DISTFILE[1]= freezegun-1.5.1-py3-none-any.whl:main DIST_SUBDIR= python-src DF_INDEX= 1 SPKGS[v12]= single SPKGS[v13]= single OPTIONS_AVAILABLE= PY312 PY313 OPTIONS_STANDARD= none VOPTS[v12]= PY312=ON PY313=OFF VOPTS[v13]= PY312=OFF PY313=ON DISTNAME= freezegun-1.5.1.dist-info GENERATED= yes [PY312].RUN_DEPENDS_ON= python-python-dateutil:single:v12 [PY312].USES_ON= python:v12,wheel [PY313].RUN_DEPENDS_ON= python-python-dateutil:single:v13 [PY313].USES_ON= python:v13,wheel [FILE:3006:descriptions/desc.single] FreezeGun: Let your Python tests travel through time ==================================================== FreezeGun is a library that allows your Python tests to travel through time by mocking the datetime module. Usage ----- Once the decorator or context manager have been invoked, all calls to datetime.datetime.now(), datetime.datetime.utcnow(), datetime.date.today(), time.time(), time.localtime(), time.gmtime(), and time.strftime() will return the time that has been frozen. time.monotonic() and time.perf_counter() will also be frozen, but as usual it makes no guarantees about their absolute value, only their changes over time. Decorator ~~~~~~~~~ .. code-block:: python from freezegun import freeze_time import datetime import unittest # Freeze time for a pytest style test: @freeze_time("2012-01-14") def test(): assert datetime.datetime.now() == datetime.datetime(2012, 1, 14) # Or a unittest TestCase - freezes for every test, and set up and tear down code @freeze_time("1955-11-12") class MyTests(unittest.TestCase): def test_the_class(self): assert datetime.datetime.now() == datetime.datetime(1955, 11, 12) # Or any other class - freezes around each callable (may not work in every case) @freeze_time("2012-01-14") class Tester(object): def test_the_class(self): assert datetime.datetime.now() == datetime.datetime(2012, 1, 14) # Or method decorator, might also pass frozen time object as kwarg class TestUnitTestMethodDecorator(unittest.TestCase): @freeze_time('2013-04-09') def test_method_decorator_works_on_unittest(self): self.assertEqual(datetime.date(2013, 4, 9), datetime.date.today()) @freeze_time('2013-04-09', as_kwarg='frozen_time') def test_method_decorator_works_on_unittest(self, frozen_time): self.assertEqual(datetime.date(2013, 4, 9), datetime.date.today()) self.assertEqual(datetime.date(2013, 4, 9), frozen_time.time_to_freeze.today()) @freeze_time('2013-04-09', as_kwarg='hello') def test_method_decorator_works_on_unittest(self, **kwargs): self.assertEqual(datetime.date(2013, 4, 9), datetime.date.today()) self.assertEqual(datetime.date(2013, 4, 9), kwargs.get('hello').time_to_freeze.today()) Context manager ~~~~~~~~~~~~~~~ .. code-block:: python from freezegun import freeze_time def test(): assert datetime.datetime.now() != datetime.datetime(2012, 1, 14) with freeze_time("2012-01-14"): assert datetime.datetime.now() == datetime.datetime(2012, 1, 14) assert datetime.datetime.now() != datetime.datetime(2012, 1, 14) Raw use ~~~~~~~ .. code-block:: python from freezegun import freeze_time freezer = freeze_time("2012-01-14 12:00:01") freezer.start() assert datetime.datetime.now() == datetime.datetime(2012, 1, 14, 12, 0, 1) freezer.stop() Timezones ~~~~~~~~~ [FILE:122:distinfo] bf111d7138a8abe55ab48a71755673dbaa4ab87f4cff5634a4442dfec34c15f1 17569 python-src/freezegun-1.5.1-py3-none-any.whl