Skip to content

Commit

Permalink
Move the test in the right module (with the windows support crap).
Browse files Browse the repository at this point in the history
  • Loading branch information
ionelmc committed Oct 28, 2024
1 parent 2b56483 commit 8e30fe3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
23 changes: 0 additions & 23 deletions tests/test_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -1209,26 +1209,3 @@ def test_columns(testdir):
'------*',
]
)


def test_compare_csv(testdir):
test = testdir.makepyfile("""
import pytest
@pytest.mark.parametrize("arg", ["foo", "bar"])
def test1(benchmark, arg):
def func():
print(arg)
benchmark(func)
def test2(benchmark):
def func():
print("foo")
benchmark(func)
""")
result = testdir.runpytest_subprocess('--benchmark-autosave', test)
result.stderr.fnmatch_lines(
[
'Saved benchmark data in: *',
]
)
result = testdir.run('py.test-benchmark', 'compare', '--csv')
result.stderr.fnmatch_lines(['Generated csv: *.csv'])
23 changes: 23 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,26 @@ def test_compare(testdir, name, name_pattern_generator):
]
)
assert result.ret == 0


def test_compare_csv(testdir):
test = testdir.makepyfile("""
import pytest
@pytest.mark.parametrize("arg", ["foo", "bar"])
def test1(benchmark, arg):
def func():
print(arg)
benchmark(func)
def test2(benchmark):
def func():
print("foo")
benchmark(func)
""")
result = testdir.runpytest_subprocess('--benchmark-autosave', test)
result.stderr.fnmatch_lines(
[
'Saved benchmark data in: *',
]
)
result = testdir.run('py.test-benchmark', 'compare', '--csv')
result.stderr.fnmatch_lines(['Generated csv: *.csv'])

0 comments on commit 8e30fe3

Please sign in to comment.