Skip to content

Commit

Permalink
fix: fixed the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Rishabh672003 committed Jul 1, 2024
1 parent f609f94 commit 6e588dc
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
20 changes: 6 additions & 14 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }

Expand Down
20 changes: 18 additions & 2 deletions tests/mod_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from pyfix_imports.pyflake import pyflake

from tests.test import test_code


def check_code(output):
mod_list = pyflake(output)

Expand All @@ -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",
}

0 comments on commit 6e588dc

Please sign in to comment.