Skip to content

Commit fab53df

Browse files
guilhermeleobaspytorchmergebot
authored andcommitted
Fixes for CPython int/float tests (#155978)
Pull Request resolved: #155978 Approved by: https://github.com/zou3519
1 parent ffaed8c commit fab53df

File tree

78 files changed

+55
-13
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+55
-13
lines changed

test/dynamo/cpython/3_13/test_int.diff

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/test/dynamo/cpython/3_13/test_int.py b/test/dynamo/cpython/3_13/test_int.py
2-
index 48825f46911..ac7aeacbc01 100644
2+
index 48825f46911..4ab200372ea 100644
33
--- a/test/dynamo/cpython/3_13/test_int.py
44
+++ b/test/dynamo/cpython/3_13/test_int.py
55
@@ -1,13 +1,137 @@
@@ -153,7 +153,15 @@ index 48825f46911..ac7aeacbc01 100644
153153

154154
def test_basic(self):
155155
self.assertEqual(int(314), 314)
156-
@@ -607,7 +731,7 @@ class IntTestCases(unittest.TestCase):
156+
@@ -566,6 +690,7 @@ class IntTestCases(unittest.TestCase):
157+
self.assertEqual(n, 1)
158+
self.assertIs(type(n), IntSubclass)
159+
160+
+ @skipIfTorchDynamo("flaky under dynamo")
161+
def test_error_message(self):
162+
def check(s, base=None):
163+
with self.assertRaises(ValueError,
164+
@@ -607,7 +732,7 @@ class IntTestCases(unittest.TestCase):
157165
self.assertEqual(int('1_2_3_4_5_6_7', 32), 1144132807)
158166

159167

@@ -162,7 +170,7 @@ index 48825f46911..ac7aeacbc01 100644
162170

163171
int_class = int # Override this in subclasses to reuse the suite.
164172

165-
@@ -818,7 +942,7 @@ class IntSubclassStrDigitLimitsTests(IntStrDigitLimitsTests):
173+
@@ -818,7 +943,7 @@ class IntSubclassStrDigitLimitsTests(IntStrDigitLimitsTests):
166174
int_class = IntSubclass
167175

168176

@@ -171,7 +179,7 @@ index 48825f46911..ac7aeacbc01 100644
171179
# Tests of the functions in _pylong.py. Those get used when the
172180
# number of digits in the input values are large enough.
173181

174-
@@ -922,4 +1046,4 @@ class PyLongModuleTests(unittest.TestCase):
182+
@@ -922,4 +1047,4 @@ class PyLongModuleTests(unittest.TestCase):
175183
bits <<= 1
176184

177185
if __name__ == "__main__":

test/dynamo/cpython/3_13/test_int.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import torch._dynamo.test_case
1010
import unittest
1111
from torch._dynamo.test_case import CPythonTestCase
12-
from torch.testing._internal.common_utils import run_tests
12+
from torch.testing._internal.common_utils import run_tests, skipIfTorchDynamo
1313

1414
__TestCase = CPythonTestCase
1515

@@ -690,6 +690,7 @@ def __trunc__(self):
690690
self.assertEqual(n, 1)
691691
self.assertIs(type(n), IntSubclass)
692692

693+
@skipIfTorchDynamo("flaky under dynamo")
693694
def test_error_message(self):
694695
def check(s, base=None):
695696
with self.assertRaises(ValueError,

test/dynamo_expected_failures/CPython313-test_complex-ComplexTest.test_truediv_zero_division

Whitespace-only changes.

test/dynamo_expected_failures/CPython313-test_contextlib-ContextManagerTestCase.test_contextmanager_except

Whitespace-only changes.

test/dynamo_expected_failures/CPython313-test_contextlib-ContextManagerTestCase.test_contextmanager_finally

Whitespace-only changes.

test/dynamo_expected_failures/CPython313-test_contextlib-ContextManagerTestCase.test_contextmanager_plain

Whitespace-only changes.

test/dynamo_expected_failures/CPython313-test_contextlib-ContextManagerTestCase.test_keywords

Whitespace-only changes.

test/dynamo_expected_failures/CPython313-test_contextlib-TestContextDecorator.test_contextdecorator

Whitespace-only changes.

test/dynamo_expected_failures/CPython313-test_contextlib-TestContextDecorator.test_contextmanager_as_decorator

Whitespace-only changes.

test/dynamo_expected_failures/CPython313-test_contextlib-TestContextDecorator.test_decorator

Whitespace-only changes.

0 commit comments

Comments
 (0)