This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cProfile, os, pathlib | |
from pytest import fixture | |
PROFILING_DIR = pathlib.Path("/tmp") # wherever you want the resulting files to show up | |
@fixture() | |
def profile(request): | |
""" | |
Use this fixture in a test to profile the test. The test results end up as | |
pstats files in: |