diff --git a/pyqso/adif.py b/pyqso/adif.py index 51cbe5b..7cc1e5b 100644 --- a/pyqso/adif.py +++ b/pyqso/adif.py @@ -675,7 +675,8 @@ class TestADIF(unittest.TestCase): """ Check that records can be written to an ADIF file from a test database file. """ import sqlite3 import os.path - self.connection = sqlite3.connect(os.path.dirname(os.path.realpath(__file__))+"/unittest_resources/test.db") + path_to_test_database = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir, "res/test.db") + self.connection = sqlite3.connect(path_to_test_database) self.connection.row_factory = sqlite3.Row c = self.connection.cursor() diff --git a/pyqso/logbook.py b/pyqso/logbook.py index cf3cf40..e52f1ea 100644 --- a/pyqso/logbook.py +++ b/pyqso/logbook.py @@ -1336,7 +1336,8 @@ class TestLogbook(unittest.TestCase): def setUp(self): """ Set up the Logbook object and connection to the test database needed for the unit tests. """ self.logbook = Logbook(application=mock.MagicMock()) - success = self.logbook.db_connect(os.path.dirname(os.path.realpath(__file__))+"/unittest_resources/test.db") + path_to_test_database = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir, "res/test.db") + success = self.logbook.db_connect(path_to_test_database) assert success def tearDown(self): diff --git a/pyqso/unittest_resources/test.db b/res/test.db similarity index 100% rename from pyqso/unittest_resources/test.db rename to res/test.db