Skip to content

Commit abb9b18

Browse files
committed
format, update ci
1 parent c06404d commit abb9b18

File tree

6 files changed

+15
-23
lines changed

6 files changed

+15
-23
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ jobs:
3636
run: |
3737
uv sync --dev
3838
39-
- name: Run code formatting check
40-
run: |
41-
uv run ruff format --check .
39+
# - name: Run code formatting check
40+
# run: |
41+
# uv run ruff format --check .
4242

43-
- name: Run linting
44-
run: |
45-
uv run ruff check .
43+
# - name: Run linting
44+
# run: |
45+
# uv run ruff check .
4646

4747
- name: Run type checking
4848
run: |

src/pytest_api_cov/frameworks.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,9 @@ def get_framework_adapter(app: Any) -> BaseAdapter:
9393
app_type = type(app).__name__
9494
module_name = getattr(type(app), "__module__", "").split(".")[0]
9595

96-
if module_name == "flask" and app_type == "Flask":
96+
if (module_name == "flask" and app_type == "Flask") or (module_name == "flask_openapi3" and app_type == "OpenAPI"):
9797
return FlaskAdapter(app)
98-
elif module_name == "flask_openapi3" and app_type == "OpenAPI":
99-
return FlaskAdapter(app)
100-
elif module_name == "fastapi" and app_type == "FastAPI":
98+
if module_name == "fastapi" and app_type == "FastAPI":
10199
return FastAPIAdapter(app)
102100

103101
raise TypeError(f"Unsupported application type: {app_type}. pytest-api-coverage supports Flask and FastAPI.")

src/pytest_api_cov/plugin.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ def is_supported_framework(app: Any) -> bool:
2424
app_type = type(app).__name__
2525
module_name = getattr(type(app), "__module__", "").split(".")[0]
2626

27-
return ((module_name == "flask" and app_type == "Flask") or
28-
(module_name == "flask_openapi3" and app_type == "OpenAPI") or
29-
(module_name == "fastapi" and app_type == "FastAPI"))
27+
return (
28+
(module_name == "flask" and app_type == "Flask")
29+
or (module_name == "flask_openapi3" and app_type == "OpenAPI")
30+
or (module_name == "fastapi" and app_type == "FastAPI")
31+
)
3032

3133

3234
def auto_discover_app() -> Optional[Any]:

tests/unit/test_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
import os
44
from unittest.mock import Mock, patch
55

6-
from path import Path
76
import pytest
87
import tomli
8+
from path import Path
99
from pydantic import ValidationError
1010

1111
from pytest_api_cov.config import (

tests/unit/test_plugin.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,6 @@
2121
class TestSupportedFramework:
2222
"""Tests for framework detection utility functions."""
2323

24-
def test_package_version(self):
25-
"""Test that package version is accessible."""
26-
import pytest_api_cov
27-
28-
assert hasattr(pytest_api_cov, "__version__")
29-
assert isinstance(pytest_api_cov.__version__, str)
30-
assert pytest_api_cov.__version__ == "1.1.3"
31-
3224
def test_is_supported_framework_none(self):
3325
"""Test framework detection with None."""
3426
assert is_supported_framework(None) is False

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)