Skip to content
Permalink
Browse files

fix legacy test case (skip, if no conversion)

  • Loading branch information...
marscher committed Jun 18, 2019
1 parent cf46086 commit 85fb02890c1f18a7dc0582908d6941a953e61b3b
Showing with 11 additions and 4 deletions.
  1. +2 −0 .travis.yml
  2. +4 −3 test/jpypetest/common.py
  3. +5 −1 test/jpypetest/test_legacy.py
@@ -47,6 +47,7 @@ matrix:
dist: xenial
language: python

# TODO: remove in 0.8
- name: "Python 2.7 on Xenial Linux"
python: 2.7
dist: xenial
@@ -71,6 +72,7 @@ matrix:
- PYTHON=python3
- PIP=pip3

# TODO: remove in 0.8
- name: "Python 3.7 on Xenial Linux"
python: 3.7
dist: xenial
@@ -38,10 +38,11 @@ def setUp(self):
logger.info("Running testsuite using JVM %s" % jvm_path)
classpath_arg = "-Djava.class.path=%s"
classpath_arg %= jpype.getClassPath()
str_conversion = os.getenv('JPYPE_STR_CONVERSION', True) == 'False'
self.__class__.str_conversion = eval(os.getenv('JPYPE_STR_CONVERSION', True))
jpype.startJVM(jvm_path, "-ea",
# "-Xcheck:jni",
"-Xmx256M", "-Xms16M", classpath_arg, convertStrings=str_conversion)
# TODO: enabling this check crashes the JVM with: FATAL ERROR in native method: Bad global or local ref passed to JNI
#"-Xcheck:jni",
"-Xmx256M", "-Xms16M", classpath_arg, convertStrings=self.__class__.str_conversion)
self.jpype = jpype.JPackage('jpype')
if sys.version < '3':
self.assertCountEqual = self.assertItemsEqual
@@ -26,11 +26,15 @@ def proxy(s):
raise TypeError("Fail")
return s

# This is a test case to exercise all of the paths that pass through

# This is a test case to exercise all of the paths that pass through
# the string conversion to make sure all are exercised.
class LegacyTestCase(common.JPypeTestCase):
def setUp(self):
common.JPypeTestCase.setUp(self)
# TODO: remove in 0.8
if not self.str_conversion:
raise unittest.SkipTest
self._test = jpype.JClass("jpype.str.Test")
self._intf = jpype.JClass("jpype.str.StringFunction")

0 comments on commit 85fb028

Please sign in to comment.
You can’t perform that action at this time.