diff --git a/.github/workflows/legacy.yml b/.github/workflows/legacy.yml deleted file mode 100644 index 7199e2e5..00000000 --- a/.github/workflows/legacy.yml +++ /dev/null @@ -1,32 +0,0 @@ -# This workflow validates that (new) variables are not referenced as deprecated legacy variables -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: Guard against legacy variables - -on: - push: - branches: [ main ] - pull_request: - branches: [ '**' ] - -jobs: - legacy-validation: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python 3.11 - uses: actions/setup-python@v4 - with: - python-version: 3.11 - - - name: Install requirements - run: pip install -r requirements.txt - - - name: Install pytest - run: pip install pytest - - - name: Run the legacy validation - run: pytest tests/test_legacy.py diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml new file mode 100644 index 00000000..44fce687 --- /dev/null +++ b/.github/workflows/pytest.yml @@ -0,0 +1,32 @@ +# This workflow runs all tests using pytest +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Run pytest + +on: + push: + branches: [ main ] + pull_request: + branches: [ '**' ] + +jobs: + pytest: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python 3.11 + uses: actions/setup-python@v4 + with: + python-version: 3.11 + + - name: Install requirements + run: pip install -r requirements.txt + + - name: Install pytest + run: pip install pytest + + - name: Run pytest + run: pytest tests diff --git a/tests/test_reserved_terms.py b/tests/test_reserved_terms.py index f2c26759..c917eaa0 100644 --- a/tests/test_reserved_terms.py +++ b/tests/test_reserved_terms.py @@ -16,8 +16,8 @@ def test_variable_ops_as_square_brackets(): error = [] for variable in dsd.variable: if reserved_terms := [r for r in RESERVED_TERMS if "|" + r in variable]: - error.append(f"Variable '{variable}' -> '... [{''.join(reserved_terms)}]'") + error.append(f"'{variable}' -> '... [{''.join(reserved_terms)}]'") if error: raise ValueError( - f"Found reserved terms in the following variables:\n{'\n - '.join(error)}" + "Reserved terms in the following variables:\n - " + "\n - ".join(error) )