From 0ce6c6bf5256f7e054a35bfde7f63ec8039104ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=A9chal?= Date: Fri, 12 Apr 2024 16:35:27 +0200 Subject: [PATCH 1/2] =?UTF-8?q?remove=20pytest=20=F0=9F=98=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yaml | 26 -------------------------- requirements-dev.txt | 1 - tests/__init__.py | 0 tests/conftest.py | 27 --------------------------- tests/tests_utils/__init__.py | 0 5 files changed, 54 deletions(-) delete mode 100644 tests/__init__.py delete mode 100644 tests/conftest.py delete mode 100644 tests/tests_utils/__init__.py diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7203ce9..2fdb965 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -21,29 +21,3 @@ jobs: - uses: chartboost/ruff-action@v1 with: args: "format --diff" - - tests: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Cache virtualenv - uses: actions/cache@v3 - with: - key: venv-${{ runner.os }}-${{ steps.setup_python.outputs.python-version}}-${{ hashFiles('requirements.txt') }} - path: .venv - - name: Install dependencies - run: | - python -m venv .venv - source .venv/bin/activate - python -m pip install --upgrade pip - python -m pip install -r requirements-dev.txt - echo "$VIRTUAL_ENV/bin" >> $GITHUB_PATH - echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV - - name: Run tests - run: pytest . diff --git a/requirements-dev.txt b/requirements-dev.txt index b7565e5..e2abf45 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,3 @@ -r requirements.txt pre-commit ~= 3.5 -pytest ~= 8.0 ruff == 0.3.5 diff --git a/tests/__init__.py b/tests/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/tests/conftest.py b/tests/conftest.py deleted file mode 100644 index 2fcdd6c..0000000 --- a/tests/conftest.py +++ /dev/null @@ -1,27 +0,0 @@ -import os - -import pytest - - -@pytest.fixture -def set_env(): - """Factory fixture that allows to add env variables. - - Environment variables created with this fixture only exist within the test. - - Examples: - def test_foo(set_env): - set_env(a="34", b="Hello World") - import os - assert os.environ.get("a") == "34" - """ - added_env = [] - - def _wrapped(**kwargs): - added_env.extend(kwargs.keys()) - os.environ.update(kwargs) - - yield _wrapped - - for key in added_env: - os.environ.pop(key) diff --git a/tests/tests_utils/__init__.py b/tests/tests_utils/__init__.py deleted file mode 100644 index e69de29..0000000 From daae31e0452b000b7d7bfadc6bfd0f1ba9269cd8 Mon Sep 17 00:00:00 2001 From: Zalk0 <88582103+zalk0@users.noreply.github.com> Date: Fri, 12 Apr 2024 16:46:13 +0200 Subject: [PATCH 2/2] chore: remove pytest rule and config --- pyproject.toml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 39d2622..f6cbe10 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,13 +4,9 @@ license = "MIT" requires-python = ">=3.8" [tool.ruff.lint] -select = ["E", "F", "I", "UP", "B", "RET", "SIM", "PT", "RUF", "T20", "ERA", "INP", "ASYNC"] +select = ["E", "F", "I", "UP", "B", "RET", "SIM", "RUF", "T20", "ERA", "INP", "ASYNC"] ignore = ["E501"] -[tool.ruff.lint.flake8-pytest-style] -fixture-parentheses = false -mark-parentheses = false - [tool.ruff] line-length = 99