{"categories":[{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/2"}],"enrichment":{"capability":"pytest-freezegun provides a pytest plugin that freezes time in tests using freezegun, allowing you to control the system clock within test functions and fixtures.","skillfed_tags":["pytest-plugin","time-mocking","test-fixtures"],"use_cases":["Test code that checks if a deadline has passed by freezing time at a specific date and asserting the expected behavior.","Verify that scheduled tasks trigger correctly by advancing frozen time and checking task execution.","Test time-dependent calculations (e.g., age, interest accrual) by setting the clock to known dates.","Ensure that retry logic with exponential backoff works as expected by controlling time progression.","Test timezone-aware datetime handling by freezing time at specific moments across different zones."],"what_it_does":"pytest-freezegun is a pytest plugin that integrates freezegun's time-freezing capability into the pytest testing framework. It provides a `freezer` fixture that you can inject into test functions to freeze and manipulate the system clock, and a `@pytest.mark.freeze_time` decorator for marking tests that should run with time frozen. This is useful when testing code that depends on the current date or time\u2014you can freeze time at a specific moment, advance it, or move to a different date entirely, all within a single test, ensuring reproducible and deterministic behavior.\n\nThe plugin works with both function-based and class-based tests, integrates with other fixtures, and allows you to pass arguments to freezegun via the decorator. Because it depends on freezegun and pytest, you need both installed. The package is no longer actively maintained, with the last release in 2020 and no updates since then, so it may have compatibility issues with recent versions of pytest or Python.","worth_installing":"Yes, if your project is on a stable pytest and Python version and you need straightforward time-freezing in tests. No, if you require active maintenance or compatibility with recent pytest/Python releases\u2014the package is abandoned and may break with newer versions. Consider it a low-risk, low-friction addition to an established test suite, but not a foundation for new projects expecting long-term support."},"id":"pytest-freezegun","links":{"html":"https://skillfed.io/packages/pytest-freezegun","md":"https://skillfed.io/packages/pytest-freezegun.md","pypi":"https://pypi.org/project/pytest-freezegun/"},"maintenance":{"status":"abandoned"},"meta":{"latest_release":"2020-07-19","license_spdx":null,"license_treatment":"permissive","name":"pytest-freezegun","python_support":"unspecified","summary":"Wrap tests with fixtures in freeze_time"},"popularity":{"monthly_downloads":1437061,"position":3899,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"0.4.2"}
