From 6e588dcd0fbfe228ba00189156c2571fdf6020e0 Mon Sep 17 00:00:00 2001 From: Rishabh <53911515+Rishabh672003@users.noreply.github.com> Date: Mon, 1 Jul 2024 15:25:00 +0530 Subject: [PATCH] fix: fixed the tests --- .github/workflows/python-app.yml | 20 ++++++-------------- pyproject.toml | 2 +- tests/mod_test.py | 20 ++++++++++++++++++-- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 26a7995..33f3b13 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -13,26 +13,18 @@ permissions: contents: read jobs: - Testing: - runs-on: ${{ matrix.os }} - strategy: - matrix: - python-version: ["3.10", "3.11", "3.12"] - os: [ubuntu-latest, macOS-latest, windows-latest] + build: + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up PDM + - name: Setup PDM uses: pdm-project/setup-pdm@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - pdm install && pip install ruff pytest + run: pdm install - name: Lint with ruff run: | ruff check . - - name: Run Tests + - name: Test with pytest run: | - pytest . + pdm run pytest diff --git a/pyproject.toml b/pyproject.toml index 95e6984..be9623a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ dependencies = [ "importlib>=1.0.4", "xdg-base-dirs>=6.0.1", ] -requires-python = ">=3.10" +requires-python = ">=3.12" readme = "README.md" license = { text = "GPL-3.0-only" } diff --git a/tests/mod_test.py b/tests/mod_test.py index 89c3301..072be30 100644 --- a/tests/mod_test.py +++ b/tests/mod_test.py @@ -1,6 +1,8 @@ from pyfix_imports.pyflake import pyflake + from tests.test import test_code + def check_code(output): mod_list = pyflake(output) @@ -11,5 +13,19 @@ def check_code(output): def test_code_output(): - assert check_code(test_code) == {'defaultdict', 'Tuple', 'List', 'mp', 'Optional', 'time', 'np', 'deque', 'os', 'itertools', 'Dict', 'dedent', 'collections', 'random'} - + assert check_code(test_code) == { + "defaultdict", + "Tuple", + "List", + "mp", + "Optional", + "time", + "np", + "deque", + "os", + "itertools", + "Dict", + "dedent", + "collections", + "random", + }