Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert to pytest #109

Merged
merged 6 commits into from
May 7, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
satisfy codacy
  • Loading branch information
weiwei committed May 7, 2023
commit 845c34702fb4429ede8379fab45f75cd15b3fe6f
6 changes: 3 additions & 3 deletions tests/test_fromfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
def tmpfile():
import tempfile

tmp = tempfile.mktemp(suffix=".xml")
tmp = tempfile.mkstemp(suffix=".xml")
yield tmp
if os.path.exists(tmp):
os.remove(tmp)
Expand Down Expand Up @@ -121,7 +121,7 @@ def test_file_is_not_xml(tmpfile):
with open(tmpfile, "w") as f:
f.write(text)
with pytest.raises(Exception):
xml = JUnitXml.fromfile(tmpfile)
JUnitXml.fromfile(tmpfile)
# Raises lxml.etree.XMLSyntaxError


Expand All @@ -130,7 +130,7 @@ def test_illegal_xml_file(tmpfile):
with open(tmpfile, "w") as f:
f.write(text)
with pytest.raises(JUnitXmlError):
xml = JUnitXml.fromfile(tmpfile)
JUnitXml.fromfile(tmpfile)


def test_write(tmpfile):
Expand Down