From ec11acdee4278223556476023cfc6d4674554740 Mon Sep 17 00:00:00 2001 From: "Christopher M. Pierce" Date: Tue, 14 Jan 2025 01:32:17 -0800 Subject: [PATCH 1/2] avoid imports in tests --- tests/__init__.py | 0 tests/test_easygdf.py | 4 +++- tests/test_initial_distribution.py | 4 +++- tests/test_screens_touts.py | 4 +++- tests/utils.py | 5 ----- 5 files changed, 9 insertions(+), 8 deletions(-) delete mode 100644 tests/__init__.py delete mode 100644 tests/utils.py diff --git a/tests/__init__.py b/tests/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/tests/test_easygdf.py b/tests/test_easygdf.py index 1104d16..d8afb00 100644 --- a/tests/test_easygdf.py +++ b/tests/test_easygdf.py @@ -6,7 +6,9 @@ import numpy as np import easygdf -from .utils import load_test_resource + +def load_test_resource(path): + return open(os.path.join(os.path.dirname(os.path.realpath(__file__)), path), "rb") class TestEasyGDFHelpers(unittest.TestCase): diff --git a/tests/test_initial_distribution.py b/tests/test_initial_distribution.py index 8cea882..353f228 100644 --- a/tests/test_initial_distribution.py +++ b/tests/test_initial_distribution.py @@ -6,7 +6,9 @@ import easygdf -from .utils import load_test_resource + +def load_test_resource(path): + return open(os.path.join(os.path.dirname(os.path.realpath(__file__)), path), "rb") class TestEasyGDFInitialDistribution(unittest.TestCase): diff --git a/tests/test_screens_touts.py b/tests/test_screens_touts.py index 7cf556e..a2d2718 100644 --- a/tests/test_screens_touts.py +++ b/tests/test_screens_touts.py @@ -4,7 +4,9 @@ import unittest import easygdf -from .utils import load_test_resource + +def load_test_resource(path): + return open(os.path.join(os.path.dirname(os.path.realpath(__file__)), path), "rb") class TestEasyGDFScreensTouts(unittest.TestCase): diff --git a/tests/utils.py b/tests/utils.py deleted file mode 100644 index 49c6bd8..0000000 --- a/tests/utils.py +++ /dev/null @@ -1,5 +0,0 @@ -import os - - -def load_test_resource(path): - return open(os.path.join(os.path.dirname(os.path.realpath(__file__)), path), "rb") From 208f1b588372c2602507a80ebafb1975f47a303a Mon Sep 17 00:00:00 2001 From: "Christopher M. Pierce" Date: Tue, 14 Jan 2025 01:35:37 -0800 Subject: [PATCH 2/2] fix workflow --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index bbcf7ed..1c7db54 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -25,4 +25,4 @@ jobs: pip install . - name: Run the tests run: | - python -m unittest + python -m unittest discover tests