Run pytest in CI

This commit is contained in:
disinvite 2023-12-22 22:40:33 -05:00
parent a1271f56d5
commit 6e93401128
2 changed files with 38 additions and 1 deletions

36
.github/workflows/unittest.yml vendored Normal file
View File

@ -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

View File

@ -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