Skip to content

Commit

Permalink
test sqlite only for jvm versions > 8
Browse files Browse the repository at this point in the history
  • Loading branch information
marscher committed Aug 20, 2024
1 parent e23f1de commit 6722c6d
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions test/jpypetest/test_sql_sqlite.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# This file is Public Domain and may be used without restrictions,
# because nobody should have to waste their lives typing this again.
import jpype
from jpype.types import *
from jpype import java
import jpype.dbapi2 as dbapi2
import common
import datetime
import decimal
import sys

Check notice

Code scanning / CodeQL

Unused import Note test

Import of 'sys' is not used.
import threading

java = jpype.java
import common
import jpype

Check notice

Code scanning / CodeQL

Module is imported with 'import' and 'import from' Note test

Module 'jpype' is imported with both 'import' and 'import from'.
import jpype.dbapi2 as dbapi2
from jpype import java, isJVMStarted
from jpype.types import *

try:
import zlib
Expand All @@ -20,12 +20,22 @@
db_name = "jdbc:sqlite::memory:"


if isJVMStarted():
java_version = str(jpype.java.lang.System.getProperty("java.version"))
java_version = java_version.split(".")

if java_version[0] == "8":# and sys.platform == "win":
raise common.unittest.SkipTest("sqlite unsupported on this config.")


class ConnectTestCase(common.JPypeTestCase):
def setUp(self):
common.JPypeTestCase.setUp(self)
if common.fast:
raise common.unittest.SkipTest("fast")



def testConnect(self):
cx = dbapi2.connect(db_name)
self.assertIsInstance(cx, dbapi2.Connection)
Expand Down

0 comments on commit 6722c6d

Please sign in to comment.