From ea69dc53d2cfca83153d9c25e2f4dddfc329317e Mon Sep 17 00:00:00 2001 From: Kangzhi Shi Date: Thu, 7 Oct 2021 10:14:50 +0200 Subject: [PATCH] remove test that fail on CPython --- extra_tests/snippets/stdlib_array.py | 7 ++++--- stdlib/src/array.rs | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/extra_tests/snippets/stdlib_array.py b/extra_tests/snippets/stdlib_array.py index c0a3dab41..2495b675d 100644 --- a/extra_tests/snippets/stdlib_array.py +++ b/extra_tests/snippets/stdlib_array.py @@ -101,6 +101,7 @@ with assert_raises(IndexError): test_str = 'πŸŒ‰abc🌐defπŸŒ‰πŸŒ' u = array('u', test_str) -assert u.__reduce_ex__(1)[1][1] == list(test_str) -assert str(loads(dumps(u, 1))) == f"array('u', '{test_str}')" -assert loads(dumps(u, 1)) == loads(dumps(u, 3)) +# skip as 2 bytes character enviroment with CPython is failing the test +if u.itemsize >= 4: + assert u.__reduce_ex__(1)[1][1] == list(test_str) + assert loads(dumps(u, 1)) == loads(dumps(u, 3)) diff --git a/stdlib/src/array.rs b/stdlib/src/array.rs index 38510f8b2..65e7d3ef8 100644 --- a/stdlib/src/array.rs +++ b/stdlib/src/array.rs @@ -13,7 +13,7 @@ mod array { use crate::vm::{ builtins::{ PyByteArray, PyBytes, PyBytesRef, PyDictRef, PyFloat, PyInt, PyIntRef, PyList, - PyListRef, PySliceRef, PyStr, PyStrRef, PyTupleRef, PyTypeRef, + PyListRef, PySliceRef, PyStr, PyStrRef, PyTypeRef, }, class_or_notimplemented, function::{ @@ -28,8 +28,8 @@ mod array { AsBuffer, AsMapping, Comparable, Iterable, IteratorIterable, PyComparisonOp, SlotConstructor, SlotIterator, }, - IdProtocol, PyComparisonValue, PyObjectRef, PyRef, PyResult, PyValue, TryFromObject, - TypeProtocol, VirtualMachine, + IdProtocol, PyComparisonValue, PyObjectRef, PyObjectWrap, PyRef, PyResult, PyValue, + TryFromObject, TypeProtocol, VirtualMachine, }; use crossbeam_utils::atomic::AtomicCell; use itertools::Itertools;