From 5bb55e29af57a6f9c1b07a9072132ead9d48cfc0 Mon Sep 17 00:00:00 2001 From: Will Dean Date: Mon, 29 Jul 2024 09:03:32 +0200 Subject: [PATCH] add test suite with tox --- .github/workflows/tests.yml | 25 +++++++++++++++++++++++++ pyproject.toml | 26 ++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..94df16d --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,25 @@ +name: Tests + +on: + - push + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + python-version: ['3.9', '3.10', '3.11', '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: | + python -m pip install --upgrade pip + pip install tox tox-gh-actions + - name: Test with tox + run: tox diff --git a/pyproject.toml b/pyproject.toml index 548d073..d90b3c2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,11 +47,37 @@ mkdocs = "^1.4.3" mkdocs-material = "^9.1.17" mkdocstrings = {extras = ["python"], version = "^0.22.0"} +[tool.ruff] +line-length = 88 + +[tool.ruff.lint.per-file-ignores] +"__init__.py" = ["F401"] +"**/tests/*" = ["S101"] + [tool.pytest.ini_options] minversion = 6.0 addopts = "--cov=lyft_bikes --cov-report=xml --cov-report=term-missing" testpaths = ["tests"] +[tool.tox] +legacy_tox_ini = """ + [tox] + min_version = 4.0 + isolated_build = true + env_list = + # tox and distutils + py312 + py311 + py310 + py39 + + [testenv] + deps = + pytest + pytest-cov + commands = pytest +""" + [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api"