Skip to content

Commit

Permalink
Merge commit 'afab56b'
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Jun 27, 2021
2 parents 0482d10 + afab56b commit 50d3109
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v0.10.1
=======

#2: Fixed isolation issue with exercise runner.

v0.10.0
=======

Expand Down
7 changes: 7 additions & 0 deletions exercises.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,10 @@ def simple_perf_test():
@control('v0.9.2')
def diff_from_oh_nine_two_perf():
pass


def check_perf_isolated():
import pytest_perf # end warmup

path = str(pytest_perf.__path__)
assert 'pip-run' in path, path
4 changes: 3 additions & 1 deletion pytest_perf/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import re
import subprocess
import contextlib
import tempfile

import pip_run
import tempora
Expand Down Expand Up @@ -89,7 +90,8 @@ def run(self, cmd: Command):
return Result(control, experiment)

def eval(self, cmd, **kwargs):
out = subprocess.check_output(cmd, **_text, **kwargs)
with tempfile.TemporaryDirectory() as empty:
out = subprocess.check_output(cmd, cwd=empty, **_text, **kwargs)
val = re.search(r'([0-9.]+ \w+) per loop', out).group(1)
return val

Expand Down

0 comments on commit 50d3109

Please sign in to comment.