Skip to content

Commit

Permalink
Run the java import * test from a sub-interpreter to allow regrtest t…
Browse files Browse the repository at this point in the history
…o be run with python.cachedir.skip=true
  • Loading branch information
groves committed Jan 24, 2009
1 parent 57c9420 commit 078a380
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 4 additions & 0 deletions Lib/test/import_star_from_java.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from java.util.regex import *

p = Pattern.compile("foo")
assert p.flags() == 0
9 changes: 2 additions & 7 deletions Lib/test/test_java_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
from org.python.core.util import FileUtil
from org.python.tests import BeanImplementation, Child, Listenable, CustomizableMapHolder

#Just for test_import_star
#java.util.regex was chosen for its small number of classes to reduce the pollution.
from java.util.regex import *

class InstantiationTest(unittest.TestCase):
def test_cant_instantiate_abstract(self):
self.assertRaises(TypeError, Component)
Expand Down Expand Up @@ -417,9 +413,8 @@ def test_adding_attributes(self):
self.assertEquals(None, m.nonexistent, "Nonexistent fields should be passed on to the Map")

def test_import_star(self):
#Depends on "from java.util.regex import *" at the top.
x = Pattern.compile("foo")
self.assertEquals(x.flags(), 0)
self.assertEquals(subprocess.call([sys.executable,
test_support.findfile("import_star_from_java.py")]), 0)

def test_main():
test_support.run_unittest(InstantiationTest,
Expand Down

0 comments on commit 078a380

Please sign in to comment.