Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xavier Thompson
cython
Commits
71e82aa9
Commit
71e82aa9
authored
Aug 07, 2017
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix tests in Py2
parent
32425ed8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
tests/run/test_coroutines_pep492.pyx
tests/run/test_coroutines_pep492.pyx
+14
-3
No files found.
tests/run/test_coroutines_pep492.pyx
View file @
71e82aa9
...
@@ -840,6 +840,10 @@ class CoroutineTest(unittest.TestCase):
...
@@ -840,6 +840,10 @@ class CoroutineTest(unittest.TestCase):
def
assertIsNotNone
(
self
,
value
,
msg
=
None
):
def
assertIsNotNone
(
self
,
value
,
msg
=
None
):
self
.
assertTrue
(
value
is
not
None
,
msg
)
self
.
assertTrue
(
value
is
not
None
,
msg
)
if
not
hasattr
(
unittest
.
TestCase
,
'assertIsInstance'
):
def
assertIsInstance
(
self
,
obj
,
cls
,
msg
=
None
):
self
.
assertTrue
(
isinstance
(
obj
,
cls
),
msg
)
def
test_gen_1
(
self
):
def
test_gen_1
(
self
):
def
gen
():
yield
def
gen
():
yield
self
.
assertFalse
(
hasattr
(
gen
,
'__await__'
))
self
.
assertFalse
(
hasattr
(
gen
,
'__await__'
))
...
@@ -1225,7 +1229,10 @@ class CoroutineTest(unittest.TestCase):
...
@@ -1225,7 +1229,10 @@ class CoroutineTest(unittest.TestCase):
result
=
run_async__await__
(
foo
())
result
=
run_async__await__
(
foo
())
self
.
assertIsInstance
(
result
[
1
],
StopIteration
)
self
.
assertIsInstance
(
result
[
1
],
StopIteration
)
if
sys
.
version_info
[
0
]
>=
3
:
self
.
assertEqual
(
result
[
1
].
value
,
10
)
self
.
assertEqual
(
result
[
1
].
value
,
10
)
else
:
self
.
assertEqual
(
result
[
1
].
args
[
0
],
10
)
def
test_cr_await
(
self
):
def
test_cr_await
(
self
):
@
types_coroutine
@
types_coroutine
...
@@ -1493,6 +1500,7 @@ class CoroutineTest(unittest.TestCase):
...
@@ -1493,6 +1500,7 @@ class CoroutineTest(unittest.TestCase):
return
await
f
()
return
await
f
()
_
,
result
=
run_async
(
g
())
_
,
result
=
run_async
(
g
())
if
sys
.
version_info
[
0
]
>=
3
:
self
.
assertIsNone
(
result
.
__context__
)
self
.
assertIsNone
(
result
.
__context__
)
# removed from CPython ?
# removed from CPython ?
...
@@ -2168,7 +2176,10 @@ class CoroutineTest(unittest.TestCase):
...
@@ -2168,7 +2176,10 @@ class CoroutineTest(unittest.TestCase):
if self.i:
if self.i:
raise StopAsyncIteration
raise StopAsyncIteration
self.i += 1
self.i += 1
if sys.version_info[0] >= 3:
return self.value
return self.value
else:
return self.args[0]
result = []
result = []
async def foo():
async def foo():
...
...
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