pytest-api-cov 1.0.1__tar.gz → 1.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,19 +1,19 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest-api-cov
3
- Version: 1.0.1
4
- Summary: Api Coverage Report Pytest Plugin
3
+ Version: 1.0.2
4
+ Summary: Pytest Plugin to provide API Coverage statistics for Python Web Frameworks
5
5
  Author-email: Barnaby Gill <barnabasgill@gmail.com>
6
6
  License: Apache-2.0
7
7
  License-File: LICENSE
8
8
  Requires-Python: >=3.10
9
- Requires-Dist: fastapi>=0.116.1
10
- Requires-Dist: flask>=3.1.1
11
- Requires-Dist: httpx>=0.28.1
12
- Requires-Dist: pydantic>=2.11.7
13
- Requires-Dist: pytest>=8.4.1
14
- Requires-Dist: rich>=14.0.0
15
- Requires-Dist: starlette>=0.47.1
16
- Requires-Dist: tomli>=2.2.1
9
+ Requires-Dist: fastapi>=0.68.0
10
+ Requires-Dist: flask>=2.0.0
11
+ Requires-Dist: httpx>=0.20.0
12
+ Requires-Dist: pydantic>=2.0.0
13
+ Requires-Dist: pytest>=6.0.0
14
+ Requires-Dist: rich>=10.0.0
15
+ Requires-Dist: starlette>=0.14.0
16
+ Requires-Dist: tomli>=1.2.0
17
17
  Description-Content-Type: text/markdown
18
18
 
19
19
  # pytest-api-cov
@@ -1,23 +1,21 @@
1
1
  [project]
2
2
  name = "pytest-api-cov"
3
- version = "1.0.1"
4
- description = "Api Coverage Report Pytest Plugin"
3
+ version = "1.0.2"
4
+ description = "Pytest Plugin to provide API Coverage statistics for Python Web Frameworks"
5
5
  readme = "README.md"
6
- authors = [
7
- {name = "Barnaby Gill", email = "barnabasgill@gmail.com"},
8
- ]
9
- license = {text = "Apache-2.0"}
6
+ authors = [{ name = "Barnaby Gill", email = "barnabasgill@gmail.com" }]
7
+ license = { text = "Apache-2.0" }
10
8
  requires-python = ">=3.10"
11
9
 
12
10
  dependencies = [
13
- "fastapi>=0.116.1",
14
- "flask>=3.1.1",
15
- "httpx>=0.28.1",
16
- "pydantic>=2.11.7",
17
- "rich>=14.0.0",
18
- "starlette>=0.47.1",
19
- "tomli>=2.2.1",
20
- "pytest>=8.4.1",
11
+ "fastapi>=0.68.0",
12
+ "flask>=2.0.0",
13
+ "httpx>=0.20.0",
14
+ "pydantic>=2.0.0",
15
+ "rich>=10.0.0",
16
+ "starlette>=0.14.0",
17
+ "tomli>=1.2.0",
18
+ "pytest>=6.0.0",
21
19
  ]
22
20
 
23
21
  [dependency-groups]
@@ -36,9 +34,7 @@ fail_under = 70
36
34
  show_covered_endpoints = true
37
35
  show_uncovered_endpoints = true
38
36
  show_excluded_endpoints = true
39
- exclusion_patterns = [
40
- "xyz",
41
- ]
37
+ exclusion_patterns = ["xyz"]
42
38
  report_path = "reports/pytest_api_cov.json"
43
39
 
44
40
  [tool.pytest.ini_options]
@@ -46,10 +42,7 @@ testpaths = ["tests/unit", "tests/integration", "example/tests"]
46
42
  pythonpath = ["src"]
47
43
 
48
44
  [tool.coverage.report]
49
- exclude_lines = [
50
- 'if __name__ == "__main__":',
51
- "if TYPE_CHECKING:",
52
- ]
45
+ exclude_lines = ['if __name__ == "__main__":', "if TYPE_CHECKING:"]
53
46
  show_missing = true
54
47
 
55
48
 
@@ -61,12 +54,7 @@ build-backend = "hatchling.build"
61
54
  packages = ["src/pytest_api_cov"]
62
55
 
63
56
  [tool.hatch.build.targets.sdist]
64
- include = [
65
- "src/pytest_api_cov/",
66
- "README.md",
67
- "LICENSE",
68
- "pyproject.toml",
69
- ]
57
+ include = ["src/pytest_api_cov/", "README.md", "LICENSE", "pyproject.toml"]
70
58
 
71
59
  # [[tool.uv.index]]
72
60
  # name = "testpypi"
@@ -63,7 +63,7 @@ from {module_path} import {app_variable}
63
63
  @pytest.fixture
64
64
  def app():
65
65
  """Provide the {framework} app for API coverage testing.
66
-
66
+
67
67
  You can import from any location - just change the import path above
68
68
  to match your project structure.
69
69
  """
@@ -65,10 +65,21 @@ def auto_discover_app() -> Optional[Any]:
65
65
  f"✅ Auto-discovered {type(app).__name__} app in {filename} as '{attr_name}'"
66
66
  )
67
67
  # Check if there are more files to scan
68
- remaining_files = [f for f in [p[0] for p in common_patterns[common_patterns.index((filename, attr_names)):]] if os.path.exists(f) and f != filename]
68
+ remaining_files = [
69
+ f
70
+ for f in [
71
+ p[0]
72
+ for p in common_patterns[common_patterns.index((filename, attr_names)) :]
73
+ ]
74
+ if os.path.exists(f) and f != filename
75
+ ]
69
76
  if remaining_files:
70
- logger.debug(f"> Note: Also found files {remaining_files} but using first discovered app")
71
- logger.debug(f"> To use a different app, create a conftest.py with an 'app' fixture")
77
+ logger.debug(
78
+ f"> Note: Also found files {remaining_files} but using first discovered app"
79
+ )
80
+ logger.debug(
81
+ "> To use a different app, create a conftest.py with an 'app' fixture"
82
+ )
72
83
  return app
73
84
  else:
74
85
  logger.debug(f"> Found '{attr_name}' in {filename} but it's not a supported framework")
@@ -80,9 +91,9 @@ def auto_discover_app() -> Optional[Any]:
80
91
  # If we get here, no apps were found
81
92
  if found_files:
82
93
  logger.debug(f"> Found files {found_files} but no supported Flask/FastAPI apps in them")
83
- logger.debug(f"> If your app is in one of these files with a different variable name,")
84
- logger.debug(f"> create a conftest.py with an 'app' fixture to specify it")
85
-
94
+ logger.debug("> If your app is in one of these files with a different variable name,")
95
+ logger.debug("> create a conftest.py with an 'app' fixture to specify it")
96
+
86
97
  logger.debug("> No app auto-discovered")
87
98
  return None
88
99
 
File without changes
File without changes