Skip to content

Commit

Permalink
Remove redundant _jvm_configured global
Browse files Browse the repository at this point in the history
  • Loading branch information
cflee committed Mar 21, 2016
1 parent b9efd87 commit 223e2d3
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

# A state variable to determine if the test environment has been configured.
_suite_configured = False
_jvm_configured = False

def setUpSuite():
"""Configure the entire test suite.
Expand Down Expand Up @@ -283,7 +282,6 @@ def setUp(self):

def setUpClass():
global _jvm
global _jvm_configured
test_dir = os.path.join(os.path.dirname(__file__))
_jvm = subprocess.Popen(
["java", "-classpath", "../dist/python-java-testdaemon.jar", "python.testdaemon.TestDaemon"],
Expand All @@ -292,15 +290,12 @@ def setUpClass():
stderr=subprocess.STDOUT,
cwd=test_dir,
)
_jvm_configured = True

def tearDownClass():
global _jvm
global _jvm_configured
if _jvm_configured:
if _jvm is None:
# use communicate here to wait for process to exit
_jvm.communicate("exit".encode())
_jvm_configured = False

def assertBlock(self, python, java):
self.maxDiff = None
Expand Down

0 comments on commit 223e2d3

Please sign in to comment.