Skip to content

Commit 4017a0b

Browse files
committed
test_interop.py: skip unsupported tests in native mode
1 parent 134b8f8 commit 4017a0b

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,13 @@
3838
# SOFTWARE.
3939

4040
import os
41+
from unittest import skipIf
42+
4143
import sys
4244

4345
if sys.implementation.name == "graalpython":
4446
import polyglot
47+
from __graalpython__ import is_native
4548

4649
def test_import():
4750
def some_function():
@@ -258,6 +261,7 @@ def test_key_info():
258261
assert not polyglot.__key_info__(builtinObj, "__len__", "removable")
259262
assert not polyglot.__key_info__(builtinObj, "__len__", "insertable")
260263

264+
@skipIf(is_native, "not supported in native mode")
261265
def test_java_classpath():
262266
import java
263267
try:
@@ -270,6 +274,7 @@ def test_java_classpath():
270274
except TypeError as e:
271275
assert "classpath argument 2 must be string, not int" in str(e)
272276

277+
@skipIf(is_native, "not supported in native mode")
273278
def test_host_lookup():
274279
import java
275280
try:
@@ -295,6 +300,7 @@ def test_internal_languages_dont_eval():
295300

296301
assert polyglot.eval(language="python", string="21 * 2") == 42
297302

303+
@skipIf(is_native, "not supported in native mode")
298304
def test_non_index_array_access():
299305
import java
300306
try:
@@ -305,6 +311,7 @@ def test_non_index_array_access():
305311
except NotImplementedError as e:
306312
assert "host lookup is not allowed" in str(e)
307313

314+
@skipIf(is_native, "not supported in native mode")
308315
def test_direct_call_of_truffle_object_methods():
309316
import java
310317
try:
@@ -334,6 +341,7 @@ def test_array_element_info():
334341
assert polyglot.__element_info__(mutableObj, 0, "modifiable")
335342
assert polyglot.__element_info__(mutableObj, 4, "insertable")
336343

344+
@skipIf(is_native, "not supported in native mode")
337345
def test_java_imports():
338346
import java
339347
try:
@@ -420,6 +428,7 @@ def test_java_exceptions():
420428
else:
421429
assert False
422430

431+
@skipIf(is_native, "not supported in native mode")
423432
def test_foreign_object_does_not_leak_Javas_toString():
424433
try:
425434
from java.util import ArrayList
@@ -458,6 +467,7 @@ def test_java_import_star():
458467
assert "getGlobal" in d
459468
assert d["getGlobal"]().getName() == d["GLOBAL_LOGGER_NAME"]
460469

470+
@skipIf(is_native, "not supported in native mode")
461471
def test_java_null_is_none():
462472
import java.lang.Integer as Integer
463473
x = Integer.getInteger("something_what_does_not_exists")
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
*graalpython.lib-python.3.test.test_timeout.CreationTestCase.testBlockingThenTimeout
22
*graalpython.lib-python.3.test.test_timeout.CreationTestCase.testFloatReturnValue
3+
*graalpython.lib-python.3.test.test_timeout.CreationTestCase.testObjectCreation
34
*graalpython.lib-python.3.test.test_timeout.CreationTestCase.testRangeCheck
45
*graalpython.lib-python.3.test.test_timeout.CreationTestCase.testReturnType
56
*graalpython.lib-python.3.test.test_timeout.CreationTestCase.testTypeCheck
7+
*graalpython.lib-python.3.test.test_timeout.TCPTimeoutTestCase.testAcceptTimeout
68
*graalpython.lib-python.3.test.test_timeout.TCPTimeoutTestCase.testConnectTimeout
9+
*graalpython.lib-python.3.test.test_timeout.TCPTimeoutTestCase.testSend
10+
*graalpython.lib-python.3.test.test_timeout.TCPTimeoutTestCase.testSendall

graalpython/com.oracle.graal.python.test/src/tests/unittest_tags/test_urllib2net.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
*graalpython.lib-python.3.test.test_urllib2net.OtherNetworkTests.test_redirect_url_withfrag
66
*graalpython.lib-python.3.test.test_urllib2net.OtherNetworkTests.test_sites_no_connection_close
77
*graalpython.lib-python.3.test.test_urllib2net.OtherNetworkTests.test_urlwithfrag
8+
*graalpython.lib-python.3.test.test_urllib2net.TimeoutTest.test_http_basic
89
*graalpython.lib-python.3.test.test_urllib2net.TimeoutTest.test_http_no_timeout
910
*graalpython.lib-python.3.test.test_urllib2net.TimeoutTest.test_http_timeout

0 commit comments

Comments
 (0)