Skip to content

Commit a205066

Browse files
Update
[ghstack-poisoned]
1 parent 6777c6d commit a205066

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

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

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/test/dynamo/cpython/3_13/test_userlist.py b/test/dynamo/cpython/3_13/test_userlist.py
2-
index 312702c8e39..5ede0c3b7f1 100644
2+
index 312702c8e39..d3d8dbf394a 100644
33
--- a/test/dynamo/cpython/3_13/test_userlist.py
44
+++ b/test/dynamo/cpython/3_13/test_userlist.py
55
@@ -1,7 +1,61 @@
@@ -65,7 +65,21 @@ index 312702c8e39..5ede0c3b7f1 100644
6565
import unittest
6666
from test import support
6767

68-
@@ -69,9 +123,9 @@ class UserListTest(list_tests.CommonTest):
68+
@@ -56,9 +110,10 @@ class UserListTest(list_tests.CommonTest):
69+
70+
def test_getitemoverwriteiter(self):
71+
# Verify that __getitem__ overrides *are* recognized by __iter__
72+
- class T(self.type2test):
73+
- def __getitem__(self, key):
74+
- return str(key) + '!!!'
75+
+ with torch._dynamo.set_fullgraph(fullgraph=False):
76+
+ class T(self.type2test):
77+
+ def __getitem__(self, key):
78+
+ return str(key) + '!!!'
79+
self.assertEqual(next(iter(T((1,2)))), "0!!!")
80+
81+
def test_userlist_copy(self):
82+
@@ -69,9 +124,9 @@ class UserListTest(list_tests.CommonTest):
6983

7084
# Decorate existing test with recursion limit, because
7185
# the test is for C structure, but `UserList` is a Python structure.

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,10 @@ def test_mixedadd(self):
110110

111111
def test_getitemoverwriteiter(self):
112112
# Verify that __getitem__ overrides *are* recognized by __iter__
113-
class T(self.type2test):
114-
def __getitem__(self, key):
115-
return str(key) + '!!!'
113+
with torch._dynamo.set_fullgraph(fullgraph=False):
114+
class T(self.type2test):
115+
def __getitem__(self, key):
116+
return str(key) + '!!!'
116117
self.assertEqual(next(iter(T((1,2)))), "0!!!")
117118

118119
def test_userlist_copy(self):

test/dynamo_expected_failures/CPython313-test_userlist-UserListTest.test_contains_order

Whitespace-only changes.

test/dynamo_expected_failures/CPython313-test_userlist-UserListTest.test_getitemoverwriteiter

Whitespace-only changes.

0 commit comments

Comments
 (0)