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
Slowest test times from pytest are incorrect #286
Comments
Actually I tried this on a fork and broke several tests. Would like your input! |
If we add |
Hm. Well, when I add it manually in my fixture, freezegun seems to work fine: from datetime import timedelta
import pytest
from freezegun import freeze_time
import time
import random
@pytest.fixture
def freezer():
with freeze_time(ignore=['_pytest.runner']) as f:
yield f
def test_asd(freezer):
a = time.time()
tick_time = random.randint(1, 1000)
freezer.tick(delta=timedelta(seconds=tick_time))
b = time.time()
assert b - a == tick_time
time.sleep(1)
assert time.time() == b
|
This will fix pytest duration calculation. Fixes spulec#286
Hello! Any update on #288? I ran into this with |
This is an issue for us as well. Our pytest output is
Removing the |
Does the issue seem to only occur inside
Result:
Versions:
|
related: #463 |
So we ended up overriding |
@yulia-che I think most people migrate to time-machine |
If I uncomment the ignore line, the durations match what I expect:
I also see in the master branch
_pytest.runner.
was added. But this doesn't work for me. Perhaps we should also add_pytest.runner
?The text was updated successfully, but these errors were encountered: