Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ffdf228

Browse files
committed
Fix tests. build_all.sh passes Python 3.9 to 3.13.
1 parent 2c64a8f commit ffdf228

File tree

1 file changed

+46
-9
lines changed

1 file changed

+46
-9
lines changed

‎tests/unit/test_c_seqobject.py

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ def test_module_dir():
1010
'__package__', '__spec__', ]
1111

1212

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 == [
1617
'__add__',
1718
'__class__',
1819
'__delattr__',
@@ -24,7 +25,44 @@ def test_SequenceLongObject_dir():
2425
'__ge__',
2526
'__getattribute__',
2627
'__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
2866
'__gt__',
2967
'__hash__',
3068
'__init__',
@@ -189,10 +227,10 @@ def test_SequenceLongObject_setitem_raises(initial_sequence, index, expected):
189227
'initial_sequence, index, expected',
190228
(
191229
(
192-
[7,], 0, [],
230+
[7,], 0, [],
193231
),
194232
(
195-
[7,], -1, [],
233+
[7,], -1, [],
196234
),
197235
(
198236
[7, 4, 1, ], 1, [7, 1, ],
@@ -218,10 +256,10 @@ def test_SequenceLongObject_delitem(initial_sequence, index, expected):
218256
[], -1, 'Index -1 is out of range for length 0',
219257
),
220258
(
221-
[7,], 1, 'Index 1 is out of range for length 1',
259+
[7,], 1, 'Index 1 is out of range for length 1',
222260
),
223261
(
224-
[7,], -3, 'Index -3 is out of range for length 1',
262+
[7,], -3, 'Index -3 is out of range for length 1',
225263
),
226264
)
227265
)
@@ -234,7 +272,6 @@ def test_SequenceLongObject_delitem_raises(initial_sequence, index, expected):
234272
del obj[index]
235273
assert err.value.args[0] == expected
236274

237-
238275
# @pytest.mark.parametrize(
239276
# 'initial_sequence, index, value, expected',
240277
# (

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /