Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Binh
erp5
Commits
f325bfd0
Commit
f325bfd0
authored
Apr 23, 2013
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix backportUnittest for Python 2.7.4
parent
ee2edadb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
product/ERP5Type/tests/backportUnittest.py
product/ERP5Type/tests/backportUnittest.py
+8
-8
No files found.
product/ERP5Type/tests/backportUnittest.py
View file @
f325bfd0
...
@@ -179,9 +179,12 @@ class TestCase(unittest.TestCase):
...
@@ -179,9 +179,12 @@ class TestCase(unittest.TestCase):
def
defaultTestResult
(
self
):
def
defaultTestResult
(
self
):
return
TestResult
()
return
TestResult
()
class
TestResult
(
unittest
.
TestResult
):
if
not
hasattr
(
unittest
.
TestResult
,
'addSkip'
):
# BBB: Python < 2.7
unittest
.
TestResult
.
_orig_init__
=
unittest
.
TestResult
.
__init__
.
im_func
def
__init__
(
self
):
def
__init__
(
self
):
s
uper
(
TestResult
,
self
).
_
_init__
()
s
elf
.
_orig
_init__
()
self
.
skipped
=
[]
self
.
skipped
=
[]
self
.
expectedFailures
=
[]
self
.
expectedFailures
=
[]
self
.
unexpectedSuccesses
=
[]
self
.
unexpectedSuccesses
=
[]
...
@@ -199,13 +202,10 @@ class TestResult(unittest.TestResult):
...
@@ -199,13 +202,10 @@ class TestResult(unittest.TestResult):
"""Called when a test was expected to fail, but succeed."""
"""Called when a test was expected to fail, but succeed."""
self
.
unexpectedSuccesses
.
append
(
test
)
self
.
unexpectedSuccesses
.
append
(
test
)
for
f
in
__init__
,
addSkip
,
addExpectedFailure
,
addUnexpectedSuccess
:
setattr
(
unittest
.
TestResult
,
f
.
__name__
,
f
)
class
_TextTestResult
(
unittest
.
_TextTestResult
,
TestResult
):
class
_TextTestResult
(
unittest
.
_TextTestResult
):
def
__init__
(
self
,
stream
,
descriptions
,
verbosity
):
# BACK: nice diamond!
# unittest.TestResult.__init__ is called twice here
unittest
.
_TextTestResult
.
__init__
(
self
,
stream
,
descriptions
,
verbosity
)
TestResult
.
__init__
(
self
)
def
wasSuccessful
(
self
):
def
wasSuccessful
(
self
):
"Tells whether or not this result was a success"
"Tells whether or not this result was a success"
...
...
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