From 22b8ed39828873d8f0074000938a7df5bda46f89 Mon Sep 17 00:00:00 2001 From: Otmar Humbel Date: Fri, 13 Nov 2026 09:47:36 +0100 Subject: [PATCH] Let JavaMakerSmokeTest dynamically get the proxy class This enables passing of 'ant javatest'. --- build.gradle | 1 - tests/java/org/python/compiler/JavaMakerSmokeTest.java | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 72c43f6cf..52bfdbee2 100644 --- a/build.gradle +++ b/build.gradle @@ -802,7 +802,6 @@ test { // FIXME: Tests that hard-code directory paths (use a symbol): exclude 'org/python/compiler/custom_proxymaker/**' - exclude 'org/python/compiler/JavaMakerSmokeTest.class' // FIXME: Failing test finds project root from test class location exclude 'org/python/core/PySystemState_registry_Test.class' diff --git a/tests/java/org/python/compiler/JavaMakerSmokeTest.java b/tests/java/org/python/compiler/JavaMakerSmokeTest.java index 9ebfb6d0a..7eeb328b3 100644 --- a/tests/java/org/python/compiler/JavaMakerSmokeTest.java +++ b/tests/java/org/python/compiler/JavaMakerSmokeTest.java @@ -8,6 +8,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.python.core.PySystemState; +import org.python.core.PyType; import org.python.core.RegistryKey; import org.python.util.PythonInterpreter; @@ -29,14 +30,12 @@ void setUp() throws Exception { String input = new String(); input += "import java.io.ByteArrayInputStream\n"; input += "import java.lang.String\n"; - input += "import org.python.core.Options\n"; - input += "org.python.core.Options.proxyDebugDirectory = 'build/testclasses'\n"; input += "class ProxyTest(java.io.ByteArrayInputStream):\n"; input += " def somemethod(self): pass\n"; input += "ProxyTest(java.lang.String('teststr').getBytes())\n"; interp.exec(input); - proxyClass = Class.forName("org.python.proxies.__main__$ProxyTest$0"); + proxyClass = interp.get("ProxyTest", PyType.class).getProxyType(); } @Test