freezegun icon indicating copy to clipboard operation
freezegun copied to clipboard

Let your Python tests travel through time

Results 149 freezegun issues
Sort by recently updated
recently updated
newest added

I see there was an attempt to start it here https://github.com/spulec/freezegun/pull/297 I finished the work.

# Handle rest_framework.throttling.SimpleRateThrottle According to the issue: https://github.com/spulec/freezegun/issues/382. I can confirm that the issue comes from an incompatibility with the DRF throttling view (see: [DRF code](https://github.com/encode/django-rest-framework/blob/3.13.1/rest_framework/throttling.py#L63)). Once the `SimpleRateThrottle.timer` is...

Details and recreation found here: https://stackoverflow.com/questions/71584885/ipdb-stops-showing-prompt-text-after-carriage-return My own debugging has shown that with tick=True or auto_tick_seconds>0 the problem goes away which for me points to the `FrozenDateTimeFactory` because of [this...

A little ipython test: ``` In [1]: import freezegun In [2]: import timeit In [3]: import time In [4]: with freezegun.freeze_time(): ...: print(timeit.default_timer()) ...: time.sleep(1) ...: print(timeit.default_timer()) ...: 2332566.128189347 2332567.128278099...

enhancement

I'm trying to use Freezegun in Pyspark 3.2.1 code, but I got the following error: ``` TypeError: field time_column: TimestampType can not accept object FakeDatetime(2012, 1, 14, 0, 0) in...

Code for replication: ``` import datetime import pandas as pd import freezegun with freezegun.freeze_time("2011-01-01"): print(pd.Timestamp.now()) print(datetime.datetime.now()) ``` Expected output: ``` 2011-01-01 00:00:00 2011-01-01 00:00:00 ``` Actual output: ``` 2019-05-20 17:14:03.781282...

While I use freezegun with google storage api, I got the following error. `google.auth.exceptions.RefreshError: ('invalid_grant: Invalid JWT: Token must be a short-lived token (60 minutes) and in a reasonable timeframe....

The following example in the README doesn't work when I run it using pytest 5.3.2 ``` from freezegun import freeze_time @freeze_time("2012-01-14", as_arg=True) def test(frozen_time): assert datetime.datetime.now() == datetime.datetime(2012, 1, 14)...

I'm not sure if I'm doing something wrong here, but this is a dataclass I haven't been able to freeze time for: ``` import datetime from dataclasses import dataclass, field...