Skip to content

Commit e8cb5a1

Browse files
author
Jakob Zanker
committed
Add support for Flask-OpenApi3
1 parent 0ebdfee commit e8cb5a1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/pytest_api_cov/frameworks.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ def get_framework_adapter(app: Any) -> BaseAdapter:
7474

7575
if module_name == "flask" and app_type == "Flask":
7676
return FlaskAdapter(app)
77+
elif module_name == "flask_openapi3" and app_type == "OpenAPI":
78+
return FlaskAdapter(app)
7779
elif module_name == "fastapi" and app_type == "FastAPI":
7880
return FastAPIAdapter(app)
7981

src/pytest_api_cov/plugin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ def is_supported_framework(app: Any) -> bool:
2525
app_type = type(app).__name__
2626
module_name = getattr(type(app), "__module__", "").split(".")[0]
2727

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

3032

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

0 commit comments

Comments
 (0)