Skip to content

@freeze_time("2012-01-14", as_arg=True) is not working#583

Merged
bblommers merged 2 commits into
spulec:masterfrom
atsuoishimoto:fix-as_arg
Aug 19, 2025
Merged

@freeze_time("2012-01-14", as_arg=True) is not working#583
bblommers merged 2 commits into
spulec:masterfrom
atsuoishimoto:fix-as_arg

Conversation

@atsuoishimoto

Copy link
Copy Markdown
Contributor

Since 1.5.4, @freeze_time("2012-01-14", as_arg=True) is not working.

❯ python
Python 3.13.1 (main, Feb  5 2025, 16:35:55) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import freezegun
>>> freezegun.__version__
'1.5.5'
>>> @freezegun.freeze_time("2012-01-14", as_arg=True)
... def test(frozen_time):
...     pass
...
>>> test()
Traceback (most recent call last):
  File "<python-input-3>", line 1, in <module>
    test()
    ~~~~^^
  File "/home/ishimoto/src/freezegun.orig/freezegun/api.py", line 951, in wrapper
    return self._call_with_time_factory(time_factory, func=func, args=args, kwargs=kwargs)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ishimoto/src/freezegun.orig/freezegun/api.py", line 934, in _call_with_time_factory
    result = func(*args, **kwargs)
TypeError: test() missing 1 required positional argument: 'frozen_time'

@atsuoishimoto

Copy link
Copy Markdown
Contributor Author

The CI for this PR has failed with an unexplained error: “Error: The operation was canceled.” However, in my repository, the tests for the same commit completed successfully. Could you kindly try re-running it?

@bblommers bblommers left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for fixing this and for adding the test cases @atsuoishimoto!

@bblommers
bblommers merged commit 92d61b3 into spulec:master Aug 19, 2025
42 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants