Skip to content

Commit c0a23ac

Browse files
refactor(test): make expected output explicit instead of calculated
1 parent accf57c commit c0a23ac

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

testing/python/show_fixtures_per_test.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -303,23 +303,23 @@ def test_indirectly_parametrized_fixture(indirectly):
303303
result = pytester.runpytest("--fixtures-per-test", p)
304304
assert result.ret == 0
305305

306-
expected_matches_for_directly_parametrized_fixture_test = [
307-
"*fixtures used by test_directly_parametrized_fixture*",
308-
"*(test_should_show_parametrized_fixtures_used_by_test.py:14)*",
309-
"directly -- test_should_show_parametrized_fixtures_used_by_test.py:4",
310-
" parametrized fixture",
311-
]
312-
313-
expected_matches_for_indirectly_parametrized_fixture_test = [
314-
"*fixtures used by test_indirectly_parametrized_fixture*",
315-
"*(test_should_show_parametrized_fixtures_used_by_test.py:17)*",
316-
"indirectly -- test_should_show_parametrized_fixtures_used_by_test.py:9",
317-
" indirectly parametrized fixture",
318-
]
319-
320-
expected_matches = (
321-
expected_matches_for_directly_parametrized_fixture_test * 2
322-
+ expected_matches_for_indirectly_parametrized_fixture_test * 2
306+
result.stdout.fnmatch_lines(
307+
[
308+
"*fixtures used by test_directly_parametrized_fixture*",
309+
"*(test_should_show_parametrized_fixtures_used_by_test.py:14)*",
310+
"directly -- test_should_show_parametrized_fixtures_used_by_test.py:4",
311+
" parametrized fixture",
312+
"*fixtures used by test_directly_parametrized_fixture*",
313+
"*(test_should_show_parametrized_fixtures_used_by_test.py:14)*",
314+
"directly -- test_should_show_parametrized_fixtures_used_by_test.py:4",
315+
" parametrized fixture",
316+
"*fixtures used by test_indirectly_parametrized_fixture*",
317+
"*(test_should_show_parametrized_fixtures_used_by_test.py:17)*",
318+
"indirectly -- test_should_show_parametrized_fixtures_used_by_test.py:9",
319+
" indirectly parametrized fixture",
320+
"*fixtures used by test_indirectly_parametrized_fixture*",
321+
"*(test_should_show_parametrized_fixtures_used_by_test.py:17)*",
322+
"indirectly -- test_should_show_parametrized_fixtures_used_by_test.py:9",
323+
" indirectly parametrized fixture",
324+
]
323325
)
324-
325-
result.stdout.fnmatch_lines(expected_matches)

0 commit comments

Comments
 (0)