Show More
@@ -133,9 +133,16 b' def knownfailureif(fail_condition, msg=None):' | |||
|
133 | 133 | # import time overhead at actual test-time. |
|
134 | 134 | import nose |
|
135 | 135 | |
|
136 | try: | |
|
137 | from pytest import xfail | |
|
138 | except ImportError: | |
|
139 | ||
|
140 | def xfail(): | |
|
141 | raise KnownFailureTest(msg) | |
|
142 | ||
|
136 | 143 | def knownfailer(*args, **kwargs): |
|
137 | 144 | if fail_condition: |
|
138 |
|
|
|
145 | xfail(msg) | |
|
139 | 146 | else: |
|
140 | 147 | return f(*args, **kwargs) |
|
141 | 148 | return nose.tools.make_decorator(f)(knownfailer) |
@@ -7,9 +7,15 b' import os' | |||
|
7 | 7 | |
|
8 | 8 | from nose.plugins.errorclass import ErrorClass, ErrorClassPlugin |
|
9 | 9 | |
|
10 | class KnownFailureTest(Exception): | |
|
11 | '''Raise this exception to mark a test as a known failing test.''' | |
|
12 | pass | |
|
10 | ||
|
11 | try: | |
|
12 | import pytest | |
|
13 | ||
|
14 | KnownFailureTest = pytest.xfail.Exception | |
|
15 | except ImportError: | |
|
16 | ||
|
17 | class KnownFailureTest(Exception): | |
|
18 | """Raise this exception to mark a test as a known failing test.""" | |
|
13 | 19 | |
|
14 | 20 | |
|
15 | 21 | class KnownFailure(ErrorClassPlugin): |
General Comments 0
You need to be logged in to leave comments.
Login now