Skip to content

Instantly share code, notes, and snippets.

@cjolowicz
Created September 23, 2021 19:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cjolowicz/5d282d0983f315ac1f2985efa5d9ee12 to your computer and use it in GitHub Desktop.
Save cjolowicz/5d282d0983f315ac1f2985efa5d9ee12 to your computer and use it in GitHub Desktop.
import time
import pytest
@pytest.hookimpl(hookwrapper=True)
def pytest_fixture_setup(fixturedef, request):
start = time.time()
yield
total = time.time() - start
with open("/tmp/log", "a") as io:
print(f"{total:.2f} {fixturedef.argname}", file=io)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment