freezegun icon indicating copy to clipboard operation
freezegun copied to clipboard

Setting tz_offset causes test fixture to freeze on yield in v1.1.0

Open primal100 opened this issue 3 years ago • 2 comments

Have an issue with 1.1.0, works fine with 1.0.0.

@pytest.fixture
def fixed_timestamp(timestamp, tz_offset) -> datetime.datetime:
    freezer = freezegun.freeze_time(timestamp, tz_offset=tz_offset)
    freezer.start()
    yield datetime.datetime.now()
    freezer.stop()

This code hangs at

yield datetime.datetime.now()

If I remove tz_offset it works.

primal100 avatar Feb 20 '21 10:02 primal100

any help from any dev would be appreciated

EvertonSA avatar Mar 19 '21 04:03 EvertonSA

I also ran into this issue. In my case, the issue did not happen with 1.0.0 and it get a freezing test (with high CPU usage) with 1.1.0 (it might also be related to the usage of multiprocessing; I'll check again when this one is fixed.)

MartinThoma avatar May 12 '21 14:05 MartinThoma