-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support the new
BINARY_OP
opcode in python 3.11
PiperOrigin-RevId: 547243343
- Loading branch information
1 parent
deb8e73
commit e570a9f
Showing
3 changed files
with
73 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1240,3 +1240,12 @@ py_test( | |
DEPS | ||
.test_base | ||
) | ||
|
||
py_test( | ||
NAME | ||
test_py_311 | ||
SRCS | ||
test_py_311.py | ||
DEPS | ||
.test_base | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
"""Tests for 3.11 support. | ||
These tests are separated into their own file because the main test suite | ||
doesn't pass under python 3.11 yet; this lets us tests individual features as we | ||
get them working. | ||
""" | ||
|
||
from pytype.tests import test_base | ||
from pytype.tests import test_utils | ||
|
||
|
||
@test_utils.skipBeforePy((3, 11), "Tests specifically for 3.11 support") | ||
class TestPy311(test_base.BaseTest): | ||
"""Tests for python 3.11 support.""" | ||
|
||
def test_binop(self): | ||
self.Check(""" | ||
def f(x: int | str): | ||
pass | ||
def g(x: int, y: int) -> int: | ||
return x & y | ||
def h(x: int, y: int): | ||
x ^= y | ||
""") | ||
|
||
|
||
if __name__ == "__main__": | ||
test_base.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters