Skip to content

Commit

Permalink
Fix tests (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
doodla authored Nov 7, 2024
1 parent b790acc commit e03302a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 23 deletions.
37 changes: 15 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
name: Build

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
unit-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]

python-version: [ "3.10", "3.11", "3.12", "3.13" ]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Initialize and activate virtual environment
run: |
python -m venv venv
source venv/bin/activate
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f requirements-test.txt ]; then pip install -r requirements-test.txt; fi
- name: Test with pytest
run: |
pytest tests
- uses: actions/checkout@v3
- name: Set up Poetry
run: |
pipx install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Initialize and activate virtual environment
run: |
poetry install
- name: Test with pytest
run: |
poetry run pytest tests
2 changes: 1 addition & 1 deletion tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def check_type_hints(obj):

try:
if isinstance(obj_value, type_hint):
if type_hint not in primitives:
if type_hint not in primitives and type(None) not in get_args(type_hint):
check_type_hints(obj_value)
else:
raise TypeHintError(
Expand Down

0 comments on commit e03302a

Please sign in to comment.