Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
6aafbd43
Commit
6aafbd43
authored
8 years ago
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sync test_typing.py with upstream git repo (typing.py was already synced).
parent
6a7b3a77
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
Lib/test/test_typing.py
Lib/test/test_typing.py
+20
-0
No files found.
Lib/test/test_typing.py
View file @
6aafbd43
import
contextlib
import
pickle
import
re
import
sys
...
...
@@ -1309,6 +1310,21 @@ class CollectionsAbcTests(TestCase):
assert
len
(
MMB
[
KT
,
VT
]())
==
0
class
OtherABCTests
(
TestCase
):
@
skipUnless
(
hasattr
(
typing
,
'ContextManager'
),
'requires typing.ContextManager'
)
def
test_contextmanager
(
self
):
@
contextlib
.
contextmanager
def
manager
():
yield
42
cm
=
manager
()
assert
isinstance
(
cm
,
typing
.
ContextManager
)
assert
isinstance
(
cm
,
typing
.
ContextManager
[
int
])
assert
not
isinstance
(
42
,
typing
.
ContextManager
)
class
NamedTupleTests
(
TestCase
):
def
test_basics
(
self
):
...
...
@@ -1447,12 +1463,16 @@ class AllTests(TestCase):
assert
'ValuesView'
in
a
assert
'cast'
in
a
assert
'overload'
in
a
if
hasattr
(
contextlib
,
'AbstractContextManager'
):
assert
'ContextManager'
in
a
# Check that io and re are not exported.
assert
'io'
not
in
a
assert
're'
not
in
a
# Spot-check that stdlib modules aren't exported.
assert
'os'
not
in
a
assert
'sys'
not
in
a
# Check that Text is defined.
assert
'Text'
in
a
if
__name__
==
'__main__'
:
...
...
This diff is collapsed.
Click to expand it.
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