Skip to content

Commit b0408fa

Browse files
authored
Merge pull request #223 from s-t-e-v-e-n-k/pytest-profiling-fix-broken-mocking
pytest-profiling: Fix mock in test_writes_summary
2 parents 10218aa + 5054ade commit b0408fa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pytest-profiling/tests/unit/test_profile.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# the top-level code in pytest_profiling will be omitted from
33
# coverage, so force it to be reloaded within this test unit under coverage
44

5+
import os.path
56
from six.moves import reload_module # @UnresolvedImport
67

78
import pytest_profiling
@@ -69,8 +70,10 @@ def test_writes_summary():
6970
with patch("pstats.Stats", return_value=stats) as Stats:
7071
plugin.pytest_sessionfinish(Mock(), Mock())
7172
plugin.pytest_terminal_summary(terminalreporter)
73+
combined = os.path.abspath(
74+
os.path.join(os.path.curdir, "prof", "combined.prof"))
7275
assert "Profiling" in terminalreporter.write.call_args[0][0]
73-
assert Stats.called_with(stats, stream=terminalreporter)
76+
Stats.assert_called_with(combined, stream=terminalreporter)
7477

7578

7679
def test_writes_summary_svg():

0 commit comments

Comments
 (0)