-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from aarhusstadsarkiv/tests
Versions 0.3.1: Tests & Fixes
- Loading branch information
Showing
24 changed files
with
604 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,32 @@ | ||
name: Linting & Test | ||
|
||
on: | ||
push | ||
push | ||
|
||
env: | ||
PYTHON_VERSION: 3.9.18 | ||
POETRY_VERSION: 1.6.1 | ||
|
||
jobs: | ||
call-linting-from-utils: | ||
uses: aarhusstadsarkiv/acautils/.github/workflows/linting_ruff-mypy.yml@main | ||
linting: | ||
uses: aarhusstadsarkiv/acautils/.github/workflows/linting_ruff-mypy.yml@main | ||
pytest: | ||
name: pytest | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
- uses: abatilo/actions-poetry@v2 | ||
with: | ||
poetry-version: ${{ env.POETRY_VERSION }} | ||
- uses: actions/setup-go@v4 | ||
- run: poetry install | ||
- run: go install github.com/richardlehane/siegfried/cmd/sf@latest | ||
- name: Unit test | ||
env: | ||
GOPATH: /home/runner/go | ||
run: | | ||
poetry run coverage run -m pytest | ||
poetry run coverage report -m --fail-under=80 --skip-empty --skip-covered |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -162,3 +162,5 @@ cython_debug/ | |
/*.db | ||
|
||
.ruff_cache/ | ||
|
||
/tests/tmp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.3.0" | ||
__version__ = "0.3.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "acacore" | ||
version = "0.3.0" | ||
version = "0.3.1" | ||
description = "" | ||
authors = ["Matteo Campinoti <[email protected]>"] | ||
license = "GPL-3.0" | ||
|
@@ -10,11 +10,13 @@ readme = "README.md" | |
python = "^3.9" | ||
pydantic = "^2.4.2" | ||
tqdm = "^4.66.1" | ||
coverage = "^7.3.2" | ||
|
||
|
||
[tool.poetry.group.dev.dependencies] | ||
ruff = "^0.0.286" | ||
black = "^23.7.0" | ||
pytest = "^7.4.3" | ||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from json import loads | ||
from pathlib import Path | ||
|
||
import pytest | ||
|
||
from acacore.utils.functions import rm_tree | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def test_folder() -> Path: | ||
return Path(__file__).parent | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def temp_folder(test_folder: Path) -> Path: | ||
return test_folder / "tmp" | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def test_files(test_folder: Path) -> Path: | ||
return test_folder / "files" | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def test_files_data(test_files: Path) -> dict[str, dict]: | ||
return loads(test_files.joinpath("files.json").read_text()) | ||
|
||
|
||
@pytest.fixture(autouse=True, scope="session") | ||
def _pre_test(temp_folder: Path): | ||
rm_tree(temp_folder) | ||
temp_folder.mkdir(parents=True, exist_ok=True) |
Oops, something went wrong.