mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-14 05:36:50 +03:00
Don't raise when in compat mode, just pass.
This commit is contained in:
parent
1f6e3429e4
commit
30d881e215
|
@ -439,10 +439,6 @@ except ImportError: # python < 2.7
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
import functools
|
import functools
|
||||||
|
|
||||||
class SkipTest(Exception):
|
|
||||||
# Pasted from py27/lib/unittest/case.py
|
|
||||||
pass
|
|
||||||
|
|
||||||
def skip(reason):
|
def skip(reason):
|
||||||
# Pasted from py27/lib/unittest/case.py
|
# Pasted from py27/lib/unittest/case.py
|
||||||
"""
|
"""
|
||||||
|
@ -452,7 +448,7 @@ except ImportError: # python < 2.7
|
||||||
if not (isinstance(test_item, type) and issubclass(test_item, TestCase)):
|
if not (isinstance(test_item, type) and issubclass(test_item, TestCase)):
|
||||||
@functools.wraps(test_item)
|
@functools.wraps(test_item)
|
||||||
def skip_wrapper(*args, **kwargs):
|
def skip_wrapper(*args, **kwargs):
|
||||||
raise SkipTest(reason)
|
pass
|
||||||
test_item = skip_wrapper
|
test_item = skip_wrapper
|
||||||
|
|
||||||
test_item.__unittest_skip__ = True
|
test_item.__unittest_skip__ = True
|
||||||
|
|
|
@ -35,7 +35,6 @@ def main():
|
||||||
else:
|
else:
|
||||||
test_runner = TestRunner()
|
test_runner = TestRunner()
|
||||||
failures = test_runner.run_tests(['djangorestframework'])
|
failures = test_runner.run_tests(['djangorestframework'])
|
||||||
|
|
||||||
cov.stop()
|
cov.stop()
|
||||||
|
|
||||||
# Discover the list of all modules that we should test coverage for
|
# Discover the list of all modules that we should test coverage for
|
||||||
|
|
Loading…
Reference in New Issue
Block a user