From 1fa136962ff033a69c951476b59aefa299921768 Mon Sep 17 00:00:00 2001 From: Josh Holmer Date: Mon, 14 Oct 2024 12:04:24 -0400 Subject: [PATCH] Add test framework --- .github/workflows/lint.yml | 4 +++- .github/workflows/test.yml | 28 ++++++++++++++++++++++++++++ .gitignore | 3 ++- pytest.ini | 2 ++ requirements-dev.txt | 2 ++ 5 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/test.yml create mode 100644 pytest.ini diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 35d3610..17491c0 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -36,4 +36,6 @@ jobs: pip install -r requirements-dev.txt - name: Running ruff - run: ruff check vsscale + run: | + ruff check vsscale + ruff check tests diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..ec72bad --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,28 @@ +name: test + +on: [push, pull_request] + +jobs: + windows: + runs-on: windows-latest + strategy: + matrix: + versions: + - 68 + python-version: + - '3.12' + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python3 -m pip install --upgrade pip + pip install vapoursynth-portable==${{ matrix.versions }} + pip install -r requirements.txt + pip install -r requirements-dev.txt + - name: Running tests + run: pytest --cov-report=term-missing:skip-covered --cov=vstools tests diff --git a/.gitignore b/.gitignore index 065ce53..2468aff 100644 --- a/.gitignore +++ b/.gitignore @@ -128,8 +128,9 @@ dmypy.json # Local test file *test*.py -# vscode folder +# Editor local configs .vscode +.idea # vsjet folder .vsjet/ diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..a635c5c --- /dev/null +++ b/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +pythonpath = . diff --git a/requirements-dev.txt b/requirements-dev.txt index a2f94d9..20e28d7 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,3 +1,5 @@ packaging>=24.0 pycodestyle>=2.11.1 +pytest>=7.3.1 +pytest-cov>=5.0.0 ruff>=0.6.5