Skip to content

Commit 634ea55

Browse files
committed
[GR-21590] Update imports.
PullRequest: graalpython/1669
2 parents 4f9659e + 23740ec commit 634ea55

File tree

5 files changed

+22
-5
lines changed

5 files changed

+22
-5
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")

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

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

4040
import platform
41-
import sys
4241
import unittest
4342

43+
import sys
44+
4445
# The platform.system() == 'Java' is to make it possible to run with Jython
45-
if platform.system() == 'Java' or sys.implementation.name == "graalpython":
46+
if (platform.system() == 'Java' or sys.implementation.name == "graalpython") and \
47+
not __graalpython__.is_native:
4648
from java.util import Arrays
4749
from java.lang import StringBuilder
4850
import jarray
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

mx.graalpython/suite.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,23 @@
4444
},
4545
{
4646
"name": "tools",
47-
"version": "315d6d694622db1fa17154c360d2471a659fb7d0",
47+
"version": "5a1d413830ed950a9051c7b76c7dfb3e146ec6eb",
4848
"subdir": True,
4949
"urls": [
5050
{"url": "https://github.com/oracle/graal", "kind": "git"},
5151
],
5252
},
5353
{
5454
"name": "sulong",
55-
"version": "315d6d694622db1fa17154c360d2471a659fb7d0",
55+
"version": "5a1d413830ed950a9051c7b76c7dfb3e146ec6eb",
5656
"subdir": True,
5757
"urls": [
5858
{"url": "https://github.com/oracle/graal", "kind": "git"},
5959
]
6060
},
6161
{
6262
"name": "regex",
63-
"version": "315d6d694622db1fa17154c360d2471a659fb7d0",
63+
"version": "5a1d413830ed950a9051c7b76c7dfb3e146ec6eb",
6464
"subdir": True,
6565
"urls": [
6666
{"url": "https://github.com/oracle/graal", "kind": "git"},

0 commit comments

Comments
 (0)