diff --git a/test/dynamo/cpython/3_13/test_numeric_tower.py b/test/dynamo/cpython/3_13/test_numeric_tower.py index 337682d6bac..85841ef5ea5 100644 --- a/test/dynamo/cpython/3_13/test_numeric_tower.py +++ b/test/dynamo/cpython/3_13/test_numeric_tower.py @@ -1,3 +1,23 @@ +# ======= BEGIN Dynamo patch ======= +# Owner(s): ["module: dynamo"] + +# ruff: noqa +# flake8: noqa + +# Test copied from +# https://raw.githubusercontent.com/python/cpython/refs/tags/v3.13.5/Lib/test/test_numeric_tower.py + +import sys +import torch +import torch._dynamo.test_case +import unittest +from torch._dynamo.test_case import CPythonTestCase +from torch.testing._internal.common_utils import run_tests + +__TestCase = CPythonTestCase + +# ======= END DYNAMO PATCH ======= + # test interactions between int, float, Decimal and Fraction import unittest @@ -35,7 +55,7 @@ class DummyIntegral(int): return DummyIntegral(1) -class HashTest(unittest.TestCase): +class HashTest(__TestCase): def check_equal_hash(self, x, y): # check both that x and y are equal and that their hashes are equal self.assertEqual(hash(x), hash(y), @@ -170,7 +190,7 @@ class HashTest(unittest.TestCase): x = {'halibut', HalibutProxy()} self.assertEqual(len(x), 1) -class ComparisonTest(unittest.TestCase): +class ComparisonTest(__TestCase): def test_mixed_comparisons(self): # ordered list of distinct test values of various types: @@ -227,4 +247,4 @@ class ComparisonTest(unittest.TestCase): if __name__ == '__main__': - unittest.main() + run_tests()