Replace py.builtin.print_() calls by builtin print() function
This commit is contained in:
@@ -274,6 +274,7 @@ class TestGenerator(object):
|
||||
|
||||
def test_order_of_execution_generator_same_codeline(self, testdir, tmpdir):
|
||||
o = testdir.makepyfile("""
|
||||
from __future__ import print_function
|
||||
def test_generative_order_of_execution():
|
||||
import py, pytest
|
||||
test_list = []
|
||||
@@ -283,8 +284,8 @@ class TestGenerator(object):
|
||||
test_list.append(item)
|
||||
|
||||
def assert_order_of_execution():
|
||||
py.builtin.print_('expected order', expected_list)
|
||||
py.builtin.print_('but got ', test_list)
|
||||
print('expected order', expected_list)
|
||||
print('but got ', test_list)
|
||||
assert test_list == expected_list
|
||||
|
||||
for i in expected_list:
|
||||
@@ -298,6 +299,7 @@ class TestGenerator(object):
|
||||
|
||||
def test_order_of_execution_generator_different_codeline(self, testdir):
|
||||
o = testdir.makepyfile("""
|
||||
from __future__ import print_function
|
||||
def test_generative_tests_different_codeline():
|
||||
import py, pytest
|
||||
test_list = []
|
||||
@@ -313,8 +315,8 @@ class TestGenerator(object):
|
||||
test_list.append(0)
|
||||
|
||||
def assert_order_of_execution():
|
||||
py.builtin.print_('expected order', expected_list)
|
||||
py.builtin.print_('but got ', test_list)
|
||||
print('expected order', expected_list)
|
||||
print('but got ', test_list)
|
||||
assert test_list == expected_list
|
||||
|
||||
yield list_append_0
|
||||
|
||||
@@ -14,7 +14,7 @@ import contextlib
|
||||
from _pytest import capture
|
||||
from _pytest.capture import CaptureManager
|
||||
from _pytest.main import EXIT_NOTESTSCOLLECTED
|
||||
from py.builtin import print_
|
||||
|
||||
|
||||
needsosdup = pytest.mark.xfail("not hasattr(os, 'dup')")
|
||||
|
||||
@@ -712,7 +712,7 @@ def test_dupfile(tmpfile):
|
||||
assert nf != tmpfile
|
||||
assert nf.fileno() != tmpfile.fileno()
|
||||
assert nf not in flist
|
||||
print_(i, end="", file=nf)
|
||||
print(i, end="", file=nf)
|
||||
flist.append(nf)
|
||||
for i in range(5):
|
||||
f = flist[i]
|
||||
@@ -786,7 +786,7 @@ class TestFDCapture(object):
|
||||
def test_stderr(self):
|
||||
cap = capture.FDCapture(2)
|
||||
cap.start()
|
||||
print_("hello", file=sys.stderr)
|
||||
print("hello", file=sys.stderr)
|
||||
s = cap.snap()
|
||||
cap.done()
|
||||
assert s == "hello\n"
|
||||
|
||||
@@ -674,7 +674,7 @@ class TestKeywordSelection(object):
|
||||
item.extra_keyword_matches.add("xxx")
|
||||
""")
|
||||
reprec = testdir.inline_run(p.dirpath(), '-s', '-k', keyword)
|
||||
py.builtin.print_("keyword", repr(keyword))
|
||||
print("keyword", repr(keyword))
|
||||
passed, skipped, failed = reprec.listoutcomes()
|
||||
assert len(passed) == 1
|
||||
assert passed[0].nodeid.endswith("test_2")
|
||||
|
||||
Reference in New Issue
Block a user