harbor run -t swe-rebench/spulec__freezegun-582
harbor download swe-rebench/spulec__freezegun-582
freezegun 1.5.4 crashes if parametrized argument is called "func" Likely introduced by this commit: https://github.com/spulec/freezegun/commit/10c93f2d6c98f82e54470b05144cd0f17d3e1b46
Reproducer:
import datetime import freezegun import pytest @pytest.mark.parametrize("func", ("a", "b")) @freezegun.freeze_time(datetime.datetime.now()) def test_freezegun_crashes(func): print(func) @pytest.mark.parametrize("arg", ("a", "b")) @freezegun.freeze_time(datetime.datetime.now()) def test_freezegun_does_not_crash(arg): print(arg)
If a test has an argument called func, pytest will crash:
func
item = <Function test_freezegun_crashes[a]> @pytest.hookimpl(wrapper=True, tryfirst=True) def pytest_runtest_call(item): > result = yield /path/to/venv/lib/python3.11/site-packages/pytestqt/plugin.py:189: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = (), kwargs = {'func': 'a'}, time_factory = <freezegun.api.FrozenDateTimeFactory object at 0x727db48800d0> @functools.wraps(func) def wrapper(*args: "P.args", **kwargs: "P.kwargs") -> T: with self as time_factory: > return self._call_with_time_factory(time_factory, func, *args, **kwargs) E TypeError: _freeze_time._call_with_time_factory() got multiple values for argument 'func'