Skip to content

Commit ea69dc5

Browse files
committed
remove test that fail on CPython
1 parent cbd7c59 commit ea69dc5

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

extra_tests/snippets/stdlib_array.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ def test_array_frombytes():
101101

102102
test_str = '🌉abc🌐def🌉🌐'
103103
u = array('u', test_str)
104-
assert u.__reduce_ex__(1)[1][1] == list(test_str)
105-
assert str(loads(dumps(u, 1))) == f"array('u', '{test_str}')"
106-
assert loads(dumps(u, 1)) == loads(dumps(u, 3))
104+
# skip as 2 bytes character enviroment with CPython is failing the test
105+
if u.itemsize >= 4:
106+
assert u.__reduce_ex__(1)[1][1] == list(test_str)
107+
assert loads(dumps(u, 1)) == loads(dumps(u, 3))

stdlib/src/array.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ mod array {
1313
use crate::vm::{
1414
builtins::{
1515
PyByteArray, PyBytes, PyBytesRef, PyDictRef, PyFloat, PyInt, PyIntRef, PyList,
16-
PyListRef, PySliceRef, PyStr, PyStrRef, PyTupleRef, PyTypeRef,
16+
PyListRef, PySliceRef, PyStr, PyStrRef, PyTypeRef,
1717
},
1818
class_or_notimplemented,
1919
function::{
@@ -28,8 +28,8 @@ mod array {
2828
AsBuffer, AsMapping, Comparable, Iterable, IteratorIterable, PyComparisonOp,
2929
SlotConstructor, SlotIterator,
3030
},
31-
IdProtocol, PyComparisonValue, PyObjectRef, PyRef, PyResult, PyValue, TryFromObject,
32-
TypeProtocol, VirtualMachine,
31+
IdProtocol, PyComparisonValue, PyObjectRef, PyObjectWrap, PyRef, PyResult, PyValue,
32+
TryFromObject, TypeProtocol, VirtualMachine,
3333
};
3434
use crossbeam_utils::atomic::AtomicCell;
3535
use itertools::Itertools;

0 commit comments

Comments
 (0)