##// END OF EJS Templates
Make separate function to monkeypatch Xunit.
Thomas Kluyver -
Show More
@@ -84,21 +84,17 b" warnings.filterwarnings('ignore', 'wxPython/wxWidgets release number mismatch',"
84 84 # ------------------------------------------------------------------------------
85 85 # Monkeypatch Xunit to count known failures as skipped.
86 86 # ------------------------------------------------------------------------------
87 if not hasattr(Xunit, 'orig_addError'):
87 def monkeypatch_xunit():
88 88 try:
89 89 knownfailureif(True)(lambda: None)()
90 90 except Exception as e:
91 91 KnownFailureTest = type(e)
92 92
93
94 93 def addError(self, test, err, capt=None):
95 94 if issubclass(err[0], KnownFailureTest):
96 95 err = (SkipTest,) + err[1:]
97 96 return self.orig_addError(test, err, capt)
98 97
99 #xunit.Xunit = Xunit
100
101
102 98 Xunit.orig_addError = Xunit.addError
103 99 Xunit.addError = addError
104 100
@@ -410,6 +406,9 b' def run_iptest():'
410 406 `iptest all`. It simply calls nose with appropriate command line flags
411 407 and accepts all of the standard nose arguments.
412 408 """
409 # Apply our monkeypatch to Xunit
410 if not hasattr(Xunit, 'orig_addError'):
411 monkeypatch_xunit()
413 412
414 413 warnings.filterwarnings('ignore',
415 414 'This will be removed soon. Use IPython.testing.util instead')
General Comments 0
You need to be logged in to leave comments. Login now