Skip to content

Commit a64ecf5

Browse files
committed
Fix Arrow tests
1 parent e6070b4 commit a64ecf5

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

graalpython/com.oracle.graal.python.test/src/tests/test_sequence_strategies.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,16 @@
4545

4646
def check_strategy(container, expected):
4747
actual = __graalpython__.get_storage_strategy(container)
48-
assert actual == expected, f"Container '{container}', wrong storage strategy: '{actual}' != '{expected}'"
48+
assert actual == expected, f"Container '{container}', wrong storage strategy : {actual=} != {expected=}"
49+
50+
LITERAL_INT_STORAGE = "NativeIntSequenceStorage" if __graalpython__.using_native_primitive_storage_strategy else "IntSequenceStorage"
4951
else:
5052
# For CPython, just to verify other test results
5153
def check_strategy(container, expected):
5254
pass
5355

56+
LITERAL_INT_STORAGE = "dummy"
57+
5458

5559
def test_appending_ints():
5660
l = list()
@@ -90,7 +94,7 @@ def test_generator_double():
9094
def test_literal_int():
9195
l = [1,2,3,4,5]
9296
assert l[4] == 5
93-
check_strategy(l, "IntSequenceStorage")
97+
check_strategy(l, LITERAL_INT_STORAGE)
9498

9599

96100
def test_literal_double():

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/GraalPythonModuleBuiltins.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@ public void postInitialize(Python3Core core) {
279279
mod.setAttribute(tsLiteral("clear_interop_type_registry"), PNone.NO_VALUE);
280280
mod.setAttribute(tsLiteral("foreign_number_list"), PNone.NO_VALUE);
281281
mod.setAttribute(tsLiteral("foreign_wrapper"), PNone.NO_VALUE);
282+
} else {
283+
addBuiltinConstant("using_native_primitive_storage_strategy", context.getLanguage().getEngineOption(PythonOptions.UseNativePrimitiveStorageStrategy));
282284
}
283285
if (PythonImageBuildOptions.WITHOUT_PLATFORM_ACCESS || !context.getOption(PythonOptions.RunViaLauncher)) {
284286
mod.setAttribute(tsLiteral("list_files"), PNone.NO_VALUE);

0 commit comments

Comments
 (0)