Add Python 3.11 tests
This commit is contained in:
parent
5000bc6871
commit
a673880cd9
2 changed files with 12 additions and 8 deletions
18
.github/workflows/python-package.yml
vendored
18
.github/workflows/python-package.yml
vendored
|
@ -15,17 +15,21 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
python-version:
|
||||||
|
- "3.10"
|
||||||
|
- "3.11"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- name: Set up Python 3.10-dev
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v2.3.1
|
||||||
with:
|
with:
|
||||||
python-version: "3.10-dev"
|
python-version: ${{ matrix.python-version }}
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python3.10 -m pip install --upgrade pip
|
pip install --upgrade pip
|
||||||
python3.10 -m pip install --upgrade pytest pytest-cov
|
pip install --upgrade pytest pytest-cov
|
||||||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||||
# - name: Lint with flake8
|
# - name: Lint with flake8
|
||||||
# run: |
|
# run: |
|
||||||
|
@ -35,7 +39,7 @@ jobs:
|
||||||
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
||||||
- name: Test with pytest
|
- name: Test with pytest
|
||||||
run: |
|
run: |
|
||||||
python3.10 -m pytest --cov=calculator tests/
|
pytest --cov=calculator tests/
|
||||||
- name: Upload coverage to Codecov
|
- name: Upload coverage to Codecov
|
||||||
uses: codecov/codecov-action@v1
|
uses: codecov/codecov-action@v1
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -7,7 +7,7 @@ class Parser:
|
||||||
self.tokens = iter(tokens)
|
self.tokens = iter(tokens)
|
||||||
self.advance()
|
self.advance()
|
||||||
|
|
||||||
def raise_error(self, e = None):
|
def raise_error(self, e=None):
|
||||||
if e:
|
if e:
|
||||||
raise Exception(f"Error: {e}")
|
raise Exception(f"Error: {e}")
|
||||||
raise Exception("Invalid syntax")
|
raise Exception("Invalid syntax")
|
||||||
|
|
Loading…
Add table
Reference in a new issue