Skip to content

Commit

Permalink
test: Update pytest coverage command in GitHub workflow
Browse files Browse the repository at this point in the history
Add source directory for coverage in pyproject.toml

Fix import statements in test files
  • Loading branch information
jjjermiah committed Jan 21, 2024
1 parent 4894aec commit f72c7d8
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
run: |
pip install pytest
pip install pytest-cov
poetry run pytest --cov=./ --cov-report=xml
poetry run pytest --cov --cov-report=xml
- name: Use Codecov to track coverage
uses: codecov/codecov-action@v3
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ python-semantic-release = "^8.5.1"
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

# [tool.coverage]
# source = "src/nbiatoolkit"

# https://python-semantic-release.readthedocs.io/en/latest/configuration.html
[tool.semantic_release]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# pytest -v -s

import pytest
from nbiatoolkit import OAuth2
from src.nbiatoolkit import OAuth2
import time
import requests

Expand Down
2 changes: 1 addition & 1 deletion tests/test_dicom_helpers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from nbiatoolkit.dicomsort.helper_functions import parseDICOMKeysFromFormat,sanitizeFileName,truncateUID
from src.nbiatoolkit.dicomsort.helper_functions import parseDICOMKeysFromFormat,sanitizeFileName,truncateUID
import pytest
###############################################################################
# parseDICOMKeysFromFormat
Expand Down
4 changes: 2 additions & 2 deletions tests/test_md5.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
from nbiatoolkit.utils.md5 import validateMD5, calculateMD5, MD5HashMismatchError
from nbiatoolkit.utils.nbia_endpoints import NBIA_ENDPOINTS
from src.nbiatoolkit.utils.md5 import validateMD5, calculateMD5, MD5HashMismatchError
from src.nbiatoolkit.utils.nbia_endpoints import NBIA_ENDPOINTS
import requests
import pytest
from tempfile import TemporaryDirectory
Expand Down
2 changes: 1 addition & 1 deletion tests/test_nbia.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# pytest -v -n 8 tests/test_nbia.py::test_getCollections

import pytest
from nbiatoolkit import NBIAClient
from src.nbiatoolkit import NBIAClient
from tempfile import TemporaryDirectory
import os

Expand Down

0 comments on commit f72c7d8

Please sign in to comment.