Skip to content

Commit f59d8f7

Browse files
kvas-itsallner
authored andcommitted
Fix the tests (#3)
* Fix the tests * Fix .format string failures on python 2.6
1 parent ee311e1 commit f59d8f7

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

_pytest/python.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2541,10 +2541,10 @@ def _log_fixture_stack(self, what):
25412541
if what == 'SETUP':
25422542
deps = sorted(arg for arg in self.argnames if arg != 'request')
25432543
if deps:
2544-
tw.write(' (fixtures used: {})'.format(', '.join(deps)))
2544+
tw.write(' (fixtures used: {0})'.format(', '.join(deps)))
25452545

25462546
if hasattr(self, 'cached_param'):
2547-
tw.write('[{}]'.format(self.cached_param))
2547+
tw.write('[{0}]'.format(self.cached_param))
25482548

25492549
if capman:
25502550
capman.resumecapture()

_pytest/runner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ def show_test_item(item):
9191
tw = item.config.get_terminal_writer()
9292
tw.line()
9393
tw.write(' ' * 8)
94-
tw.write('{}'.format(item._nodeid))
94+
tw.write('{0}'.format(item._nodeid))
9595
used_fixtures = sorted(item._fixtureinfo.name2fixturedefs.keys())
9696
if used_fixtures:
97-
tw.write(' (fixtures used: {})'.format(', '.join(used_fixtures)))
97+
tw.write(' (fixtures used: {0})'.format(', '.join(used_fixtures)))
9898

9999
def pytest_runtest_setup(item):
100100
item.session._setupstate.prepare(item)

testing/python/setup_only.py

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

1717
result.stdout.fnmatch_lines([
1818
'*SETUP F arg1*',
19-
'*test_arg1 fixtures: arg1',
19+
'*test_arg1 (fixtures used: arg1)',
2020
'*TEARDOWN F arg1*',
2121
])
2222
assert "_arg0" not in result.stdout.str()
@@ -41,7 +41,7 @@ def test_arg1(arg_session, arg_function):
4141
result.stdout.fnmatch_lines([
4242
'SETUP S arg_session*',
4343
'*SETUP F arg_function*',
44-
'*test_arg1 fixtures: arg_function, arg_session',
44+
'*test_arg1 (fixtures used: arg_function, arg_session)',
4545
'*TEARDOWN F arg_function*',
4646
'TEARDOWN S arg_session*',
4747
])
@@ -68,8 +68,8 @@ def test_arg1(arg_same):
6868

6969
result.stdout.fnmatch_lines([
7070
'SETUP S arg_same*',
71-
'*SETUP F arg_same*',
72-
'*test_arg1 fixtures: arg_same',
71+
'*SETUP F arg_same (fixtures used: arg_same)*',
72+
'*test_arg1 (fixtures used: arg_same)',
7373
'*TEARDOWN F arg_same*',
7474
'TEARDOWN S arg_same*',
7575
])
@@ -94,7 +94,7 @@ def test_arg1(arg_function):
9494
result.stdout.fnmatch_lines([
9595
'SETUP S arg_session*',
9696
'*SETUP F arg_function*',
97-
'*test_arg1 fixtures: arg_function, arg_session',
97+
'*test_arg1 (fixtures used: arg_function, arg_session)',
9898
])
9999

100100

0 commit comments

Comments
 (0)