Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
1f6e3429
Commit
1f6e3429
authored
Jan 04, 2012
by
Marko Tibold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix indentation
parent
47e4f0d3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
djangorestframework/compat.py
+15
-15
No files found.
djangorestframework/compat.py
View file @
1f6e3429
...
...
@@ -443,21 +443,21 @@ except ImportError: # python < 2.7
# Pasted from py27/lib/unittest/case.py
pass
def
skip
(
reason
):
def
skip
(
reason
):
# Pasted from py27/lib/unittest/case.py
"""
Unconditionally skip a test.
"""
def
decorator
(
test_item
):
if
not
(
isinstance
(
test_item
,
type
)
and
issubclass
(
test_item
,
TestCase
)):
@functools.wraps
(
test_item
)
def
skip_wrapper
(
*
args
,
**
kwargs
):
raise
SkipTest
(
reason
)
test_item
=
skip_wrapper
test_item
.
__unittest_skip__
=
True
test_item
.
__unittest_skip_why__
=
reason
return
test_item
return
decorator
"""
Unconditionally skip a test.
"""
def
decorator
(
test_item
):
if
not
(
isinstance
(
test_item
,
type
)
and
issubclass
(
test_item
,
TestCase
)):
@functools.wraps
(
test_item
)
def
skip_wrapper
(
*
args
,
**
kwargs
):
raise
SkipTest
(
reason
)
test_item
=
skip_wrapper
test_item
.
__unittest_skip__
=
True
test_item
.
__unittest_skip_why__
=
reason
return
test_item
return
decorator
unittest
.
skip
=
skip
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment