Fix .format string failures on python 2.6

This commit is contained in:
Vasily Kuznetsov 2016-06-22 14:53:37 +02:00
parent 1a75139f72
commit 5e0d78f4f1
2 changed files with 4 additions and 4 deletions

View File

@ -2541,10 +2541,10 @@ class FixtureDef:
if what == 'SETUP': if what == 'SETUP':
deps = sorted(arg for arg in self.argnames if arg != 'request') deps = sorted(arg for arg in self.argnames if arg != 'request')
if deps: if deps:
tw.write(' (fixtures used: {})'.format(', '.join(deps))) tw.write(' (fixtures used: {0})'.format(', '.join(deps)))
if hasattr(self, 'cached_param'): if hasattr(self, 'cached_param'):
tw.write('[{}]'.format(self.cached_param)) tw.write('[{0}]'.format(self.cached_param))
if capman: if capman:
capman.resumecapture() capman.resumecapture()

View File

@ -91,10 +91,10 @@ def show_test_item(item):
tw = item.config.get_terminal_writer() tw = item.config.get_terminal_writer()
tw.line() tw.line()
tw.write(' ' * 8) tw.write(' ' * 8)
tw.write('{}'.format(item._nodeid)) tw.write('{0}'.format(item._nodeid))
used_fixtures = sorted(item._fixtureinfo.name2fixturedefs.keys()) used_fixtures = sorted(item._fixtureinfo.name2fixturedefs.keys())
if used_fixtures: if used_fixtures:
tw.write(' (fixtures used: {})'.format(', '.join(used_fixtures))) tw.write(' (fixtures used: {0})'.format(', '.join(used_fixtures)))
def pytest_runtest_setup(item): def pytest_runtest_setup(item):
item.session._setupstate.prepare(item) item.session._setupstate.prepare(item)