-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce skipexitcode mode with tox so that we can run the PySide te…
…sts without failing due to a non-zero pytest exit code even when all tests pass
- Loading branch information
Showing
3 changed files
with
35 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import os | ||
import sys | ||
from xml.etree import ElementTree | ||
|
||
if len(sys.argv) != 2: | ||
print("Usage: python check_failures.py filename.xml") | ||
sys.exit(1) | ||
|
||
filename = sys.argv[1] | ||
|
||
if not os.path.exists(filename): | ||
print("Output file does not exist, pytest command did not complete") | ||
sys.exit(1) | ||
|
||
et = ElementTree.parse(filename) | ||
results = et.find("testsuite").attrib | ||
|
||
if int(results["errors"]) > 0 or int(results["failures"]) > 0: | ||
print("There were failures/errors as part of the test suite") | ||
sys.exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters