Skip to content

Commit 02984cd

Browse files
committed
Make JVM version test an integration test
It needs to run in an isolated Python+Java process so that we can truly validate the before-and-after of version detection. Otherwise, the test simply checks the same thing twice, which is version reporting *after* the JVM is initialized.
1 parent 9e3b0e2 commit 02984cd

2 files changed

Lines changed: 22 additions & 27 deletions

File tree

tests/it/jvm_version.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"""
2+
Test the jvm_version() function.
3+
"""
4+
5+
import scyjava
6+
7+
assert not scyjava.jvm_started()
8+
9+
before_version = scyjava.jvm_version()
10+
assert before_version is not None
11+
assert len(before_version) >= 3
12+
assert before_version[0] > 0
13+
14+
scyjava.config.add_option("-Djava.awt.headless=true")
15+
scyjava.start_jvm()
16+
17+
after_version = scyjava.jvm_version()
18+
assert after_version is not None
19+
assert len(after_version) >= 3
20+
assert after_version[0] > 0
21+
22+
assert before_version == after_version

tests/test_jvm.py

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)