@@ -10,9 +10,10 @@ def test_module_dir():
10
10
'__package__' , '__spec__' , ]
11
11
12
12
13
- def test_SequenceLongObject_dir ():
14
- obj = cSeqObject .SequenceLongObject ([7 , 4 , 1 , ])
15
- assert dir (obj ) == [
13
+ @pytest .mark .skipif (not (sys .version_info .minor < 11 ), reason = 'Python < 3.11' )
14
+ def test_SequenceLongObject_dir_pre_311 ():
15
+ result = dir (cSeqObject .SequenceLongObject )
16
+ assert result == [
16
17
'__add__' ,
17
18
'__class__' ,
18
19
'__delattr__' ,
@@ -24,7 +25,44 @@ def test_SequenceLongObject_dir():
24
25
'__ge__' ,
25
26
'__getattribute__' ,
26
27
'__getitem__' ,
27
- '__getstate__' ,
28
+ '__gt__' ,
29
+ '__hash__' ,
30
+ '__init__' ,
31
+ '__init_subclass__' ,
32
+ '__le__' ,
33
+ '__len__' ,
34
+ '__lt__' ,
35
+ '__mul__' ,
36
+ '__ne__' ,
37
+ '__new__' ,
38
+ '__reduce__' ,
39
+ '__reduce_ex__' ,
40
+ '__repr__' ,
41
+ '__rmul__' ,
42
+ '__setattr__' ,
43
+ '__setitem__' ,
44
+ '__sizeof__' ,
45
+ '__str__' ,
46
+ '__subclasshook__' ,
47
+ ]
48
+
49
+
50
+ @pytest .mark .skipif (not (sys .version_info .minor >= 11 ), reason = 'Python >= 3.11' )
51
+ def test_SequenceLongObject_dir_311_plus ():
52
+ result = dir (cSeqObject .SequenceLongObject )
53
+ assert result == [
54
+ '__add__' ,
55
+ '__class__' ,
56
+ '__delattr__' ,
57
+ '__delitem__' ,
58
+ '__dir__' ,
59
+ '__doc__' ,
60
+ '__eq__' ,
61
+ '__format__' ,
62
+ '__ge__' ,
63
+ '__getattribute__' ,
64
+ '__getitem__' ,
65
+ '__getstate__' , # New
28
66
'__gt__' ,
29
67
'__hash__' ,
30
68
'__init__' ,
@@ -189,10 +227,10 @@ def test_SequenceLongObject_setitem_raises(initial_sequence, index, expected):
189
227
'initial_sequence, index, expected' ,
190
228
(
191
229
(
192
- [7 ,], 0 , [],
230
+ [7 , ], 0 , [],
193
231
),
194
232
(
195
- [7 ,], - 1 , [],
233
+ [7 , ], - 1 , [],
196
234
),
197
235
(
198
236
[7 , 4 , 1 , ], 1 , [7 , 1 , ],
@@ -218,10 +256,10 @@ def test_SequenceLongObject_delitem(initial_sequence, index, expected):
218
256
[], - 1 , 'Index -1 is out of range for length 0' ,
219
257
),
220
258
(
221
- [7 ,], 1 , 'Index 1 is out of range for length 1' ,
259
+ [7 , ], 1 , 'Index 1 is out of range for length 1' ,
222
260
),
223
261
(
224
- [7 ,], - 3 , 'Index -3 is out of range for length 1' ,
262
+ [7 , ], - 3 , 'Index -3 is out of range for length 1' ,
225
263
),
226
264
)
227
265
)
@@ -234,7 +272,6 @@ def test_SequenceLongObject_delitem_raises(initial_sequence, index, expected):
234
272
del obj [index ]
235
273
assert err .value .args [0 ] == expected
236
274
237
-
238
275
# @pytest.mark.parametrize(
239
276
# 'initial_sequence, index, value, expected',
240
277
# (
0 commit comments