Skip to content

Commit adc50ac

Browse files
committed
Change format for test function locations
1 parent b99aace commit adc50ac

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

_pytest/python.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1253,7 +1253,7 @@ def write_item(item):
12531253

12541254
tw.line()
12551255
tw.sep('-', 'fixtures used by {0}'.format(item.name))
1256-
tw.sep('-', 'from {0}'.format(bestrel))
1256+
tw.sep('-', '({0})'.format(bestrel))
12571257
for argname, fixture_defs in sorted(name2fixturedefs.items()):
12581258
assert fixture_defs is not None
12591259
if not fixture_defs:

testing/python/show_fixtures_per_test.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def test_arg1(arg1):
2525

2626
result.stdout.fnmatch_lines([
2727
'*fixtures used by test_arg1*',
28-
'*from test_fixtures_in_module.py:9*',
28+
'*(test_fixtures_in_module.py:9)*',
2929
'arg1',
3030
' arg1 docstring',
3131
])
@@ -58,11 +58,11 @@ def test_arg3(arg3):
5858

5959
result.stdout.fnmatch_lines([
6060
'*fixtures used by test_arg2*',
61-
'*from test_fixtures_in_conftest.py:2*',
61+
'*(test_fixtures_in_conftest.py:2)*',
6262
'arg2',
6363
' arg2 docstring',
6464
'*fixtures used by test_arg3*',
65-
'*from test_fixtures_in_conftest.py:4*',
65+
'*(test_fixtures_in_conftest.py:4)*',
6666
'arg1',
6767
' arg1 docstring',
6868
'arg2',
@@ -96,7 +96,7 @@ def test_args(arg1, arg2):
9696

9797
result.stdout.fnmatch_lines([
9898
'*fixtures used by test_args*',
99-
'*from test_should_show_fixtures_used_by_test.py:6*',
99+
'*(test_should_show_fixtures_used_by_test.py:6)*',
100100
'arg1',
101101
' arg1 from testmodule',
102102
'arg2',
@@ -127,7 +127,7 @@ def test_args(arg2, arg3):
127127

128128
result.stdout.fnmatch_lines([
129129
'*fixtures used by test_args*',
130-
'*from test_verbose_include_private_fixtures_and_loc.py:6*',
130+
'*(test_verbose_include_private_fixtures_and_loc.py:6)*',
131131
'_arg1 -- conftest.py:3',
132132
' _arg1 from conftest',
133133
'arg2 -- conftest.py:6',

0 commit comments

Comments
 (0)