diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml new file mode 100644 index 00000000..06446888 --- /dev/null +++ b/.github/workflows/unittest.yml @@ -0,0 +1,36 @@ +name: Unit Tests + +on: [push, pull_request] + +jobs: + pytest-win: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v3 + + - name: Install python libraries + shell: bash + run: | + pip install pytest -r tools/requirements.txt + + - name: Run python unit tests (Windows) + shell: bash + run: | + pytest tools/isledecomp + + pytest-ubuntu: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Install python libraries + shell: bash + run: | + pip install pytest -r tools/requirements.txt + + - name: Run python unit tests (Ubuntu) + shell: bash + run: | + pytest tools/isledecomp diff --git a/tools/isledecomp/tests/test_parser_statechange.py b/tools/isledecomp/tests/test_parser_statechange.py index 714de579..8d18d547 100644 --- a/tools/isledecomp/tests/test_parser_statechange.py +++ b/tools/isledecomp/tests/test_parser_statechange.py @@ -1,3 +1,4 @@ +from typing import Optional import pytest from isledecomp.parser.parser import ( ReaderState as _rs, @@ -70,7 +71,7 @@ "state, marker_type, new_state, expected_error", state_change_marker_cases ) def test_state_change_by_marker( - state: _rs, marker_type: str, new_state: _rs, expected_error: None | _pe + state: _rs, marker_type: str, new_state: _rs, expected_error: Optional[_pe] ): p = DecompParser() p.state = state