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
c206f0d1
Commit
c206f0d1
authored
Jul 24, 2018
by
Serhiy Storchaka
Committed by
GitHub
Jul 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-34136: Make test_do_not_recreate_annotations more lenient. (GH-8437)
parent
d19d8d52
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
Lib/test/test_opcodes.py
Lib/test/test_opcodes.py
+4
-5
No files found.
Lib/test/test_opcodes.py
View file @
c206f0d1
...
...
@@ -42,14 +42,13 @@ class OpcodeTest(unittest.TestCase):
self
.
assertEqual
(
ns
[
'__annotations__'
],
{
'x'
:
int
,
1
:
2
})
def
test_do_not_recreate_annotations
(
self
):
annotations
=
{}
# Don't rely on the existence of the '__annotations__' global.
with
support
.
swap_item
(
globals
(),
'__annotations__'
,
annotations
):
with
support
.
swap_item
(
globals
(),
'__annotations__'
,
{}):
del
globals
()[
'__annotations__'
]
class
C
:
del
__annotations__
x
:
int
# Updates the '__annotations__' global.
self
.
assertIn
(
'x'
,
annotations
)
self
.
assertIs
(
annotations
[
'x'
],
int
)
with
self
.
assertRaises
(
NameError
):
x
:
int
def
test_raise_class_exceptions
(
self
):
...
...
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