mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
tests: Properly label and detect unexpected successes
Unexpected successes were being labeled as failures, which might be related to [1]. This behaviour is indeed welcome - we want to detect if tests are unexpectedly succeeding via test pipeline failures, however, the current implementation of the simpletap did not properly implement this. [1] https://bugs.python.org/issue20165
This commit is contained in:
parent
aa97cc7108
commit
095d51e479
2 changed files with 5 additions and 1 deletions
|
@ -56,7 +56,7 @@ if __name__ == "__main__":
|
|||
timestamp = re.compile("^# (\d+(?:\.\d+)?) ==>.*$")
|
||||
|
||||
expected_fail = re.compile(r"^not ok.*?#\s*TODO", re.I)
|
||||
unexpected_pass = re.compile(r"^ok .*?#\s*TODO", re.I)
|
||||
unexpected_pass = re.compile(r"^not ok .*?#\s*FIXED", re.I)
|
||||
skip = re.compile(r"^ok .*?#\s*skip", re.I)
|
||||
ok = re.compile(r"^ok ", re.I)
|
||||
not_ok = re.compile(r"^not ok", re.I)
|
||||
|
|
|
@ -162,6 +162,10 @@ class TAPTestResult(unittest.result.TestResult):
|
|||
self.stream.writeln("{0} {1} - {2}: {3} # TODO".format(
|
||||
color("not ok", "yellow"), self.testsRun, filename, desc)
|
||||
)
|
||||
elif status == "UNEXPECTED_SUCCESS":
|
||||
self.stream.writeln("{0} {1} - {2}: {3} # FIXED".format(
|
||||
color("not ok", "yellow"), self.testsRun, filename, desc)
|
||||
)
|
||||
else:
|
||||
self.stream.writeln("{0} {1} - {2}: {3}".format(
|
||||
color("not ok", "red"), self.testsRun, filename, desc)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue