Skip to content

Commit

Permalink
Fix hung test
Browse files Browse the repository at this point in the history
  • Loading branch information
tachyonicClock committed Aug 28, 2024
1 parent 5aacc90 commit 9463137
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 48 deletions.
48 changes: 0 additions & 48 deletions test/jpypetest/test_non_ascii_paths.py

This file was deleted.

12 changes: 12 additions & 0 deletions test/jpypetest/test_startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import os
from pathlib import Path
import unittest
from tempfile import TemporaryDirectory
import shutil

root = os.path.dirname(os.path.abspath(os.path.dirname(__file__)))
cp = os.path.join(root, 'classes').replace('\\', '/')
Expand Down Expand Up @@ -146,3 +148,13 @@ def testPathTwice(self):
def testBadKeyword(self):
with self.assertRaises(TypeError):
jpype.startJVM(invalid=True) # type: ignore

def testNonASCIIPath(self):
"""Test that paths with non-ASCII characters are handled correctly.
Regression test for https://github.com/jpype-project/jpype/issues/1194
"""
with TemporaryDirectory(suffix="à", delete_on_close=False) as tmp_dir:
tmp_jar = os.path.join(tmp_dir, "mrjar.jar")
shutil.copyfile("test/jar/mrjar.jar", tmp_jar)
jpype.startJVM(jvmpath=Path(self.jvmpath), classpath=tmp_jar, convertStrings=False)
assert jpype.JClass('org.jpype.mrjar.A') is not None

0 comments on commit 9463137

Please sign in to comment.