Skip to content

Commit

Permalink
migrate to unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
Kanahiro committed May 29, 2024
1 parent 16906de commit 7301756
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ on:

env:
# plugin name/directory where the code for the plugin is stored
PLUGIN_NAME: GTFS-GO
PLUGIN_NAME: gtfsgo
# python notation to test running inside plugin
TESTS_RUN_FUNCTION: test_suite.test_package
TESTS_RUN_FUNCTION: gtfsgo.test_suite.test_package
# Docker settings
DOCKER_IMAGE: qgis/qgis

Expand All @@ -33,7 +33,7 @@ jobs:
- name: Docker pull and create qgis-testing-environment
run: |
docker pull "$DOCKER_IMAGE":${{ matrix.docker_tags }}
docker run -d --name qgis-testing-environment -v "$GITHUB_WORKSPACE":/tests_directory -e DISPLAY=:99 "$DOCKER_IMAGE":${{ matrix.docker_tags }}
docker run -d --name qgis-testing-environment -v "$GITHUB_WORKSPACE":/tests_directory/gtfsgo -e DISPLAY=:99 "$DOCKER_IMAGE":${{ matrix.docker_tags }}
- name: Docker set up QGIS
run: |
Expand Down
4 changes: 2 additions & 2 deletions test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def _run_tests(test_suite, package_name, with_coverage=False):
print(fin.read())


def test_package(package="felt"):
def test_package(package="gtfsgo"):
"""Test package.
This function is called by travis without arguments.
Expand All @@ -75,7 +75,7 @@ def test_package(package="felt"):

def test_environment():
"""Test package with an environment variable."""
package = os.environ.get("TESTING_PACKAGE", "felt")
package = os.environ.get("TESTING_PACKAGE", "gtfsgo")
test_loader = unittest.defaultTestLoader
test_suite = test_loader.discover(package)
_run_tests(test_suite, package)
Expand Down

0 comments on commit 7301756

Please sign in to comment.