Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1 min difference when using auto_tick_seconds #504

Open
gerazenobi opened this issue May 23, 2023 · 0 comments
Open

1 min difference when using auto_tick_seconds #504

gerazenobi opened this issue May 23, 2023 · 0 comments

Comments

@gerazenobi
Copy link

I am using freezegun to set the time a particular datetime and have automatic tick of 10 seconds.

However at the first ticket, instead of observing a 10 seconds delta, 1 minute is observed. The second tick is correct and of 10 seconds.

def test_freeze():
    now = datetime.utcnow()
    with freeze_time(now, auto_tick_seconds=10):
        now_plus_10_seconds = datetime.utcnow()
        now_plus_20_seconds = datetime.utcnow()
        print(now) 
        print(now_plus_10_seconds) 
        print(now_plus_20_seconds)

prints:

2023-05-23 12:23:57.662732
2023-05-23 12:24:57.662732      # 1 min difference with now instead of 10 seconds
2023-05-23 12:25:07.662732      # 1 min and 10 seconds difference with now instead of 20. Correct diff with now_plus_10_seconds

versions

freezegun          1.2.2
Python 3.9.16

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

No branches or pull requests

1 participant