Skip to content

Commit

Permalink
Update error message in assert pytest-dev#3 (Why run Py3.5 when req i…
Browse files Browse the repository at this point in the history
…s 3.7?)
  • Loading branch information
Jakub Mitoraj committed Jan 7, 2020
1 parent c07fe37 commit f0c22bf
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions testing/test_junitxml.py
Expand Up @@ -489,9 +489,7 @@ def test_fail():
elif junit_logging in ["system-out", "out-err", "all"]:
systemout = tnode.find_first_by_tag("system-out")
systemout_xml = systemout.toxml()
assert (
systemout.tag == "system-out"
), f"Expected tag: system-out, actual: {systemout.tag}"
assert systemout.tag == "system-out", "Expected tag: system-out"
assert "info msg" not in systemout_xml, "INFO message found in system-out"
assert (
"hello-stdout" in systemout_xml
Expand All @@ -502,9 +500,7 @@ def test_fail():
elif junit_logging in ["system-err", "out-err", "all"]:
systemerr = tnode.find_first_by_tag("system-err")
systemerr_xml = systemerr.toxml()
assert (
systemerr.tag == "system-err"
), f"Expected tag: system-err, actual: {systemerr.tag}"
assert systemerr.tag == "system-err", "Expected tag: system-err"
assert "info msg" not in systemerr_xml, "INFO message found in system-err"
assert (
"hello-stderr" in systemerr_xml
Expand All @@ -513,7 +509,7 @@ def test_fail():
"warning msg" not in systemerr_xml
), "WARN message found in system-err"
else:
assert junit_logging == "no", f"Expected: no, actual: {junit_logging}"
assert junit_logging == "no", "Expected: no"
assert not tnode.find_by_tag("log"), "Found unexpected content: log"
assert not tnode.find_by_tag(
"system-out"
Expand Down Expand Up @@ -938,7 +934,7 @@ def test_print_nullbyte():
"""
)
xmlf = testdir.tmpdir.join("junit.xml")
testdir.runpytest("--junitxml=%s" % xmlf, "-o", f"junit_logging={junit_logging}")
testdir.runpytest("--junitxml=%s" % xmlf, "-o", "junit_logging=%s" % junit_logging)
text = xmlf.read()
assert "\x00" not in text
if junit_logging == "system-out":
Expand All @@ -960,7 +956,7 @@ def test_print_nullbyte():
"""
)
xmlf = testdir.tmpdir.join("junit.xml")
testdir.runpytest("--junitxml=%s" % xmlf, "-o", f"junit_logging={junit_logging}")
testdir.runpytest("--junitxml=%s" % xmlf, "-o", "junit_logging=%s" % junit_logging)
text = xmlf.read()
if junit_logging == "system-out":
assert "#x0" in text
Expand Down

0 comments on commit f0c22bf

Please sign in to comment.