pytest-deduplicate 0.2.0__tar.gz → 0.2.1__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.
Files changed (17) hide show
  1. {pytest_deduplicate-0.2.0/pytest_deduplicate.egg-info → pytest_deduplicate-0.2.1}/PKG-INFO +1 -1
  2. {pytest_deduplicate-0.2.0 → pytest_deduplicate-0.2.1}/pyproject.toml +1 -1
  3. {pytest_deduplicate-0.2.0 → pytest_deduplicate-0.2.1/pytest_deduplicate.egg-info}/PKG-INFO +1 -1
  4. {pytest_deduplicate-0.2.0 → pytest_deduplicate-0.2.1}/pytest_deduplicate_import.py +13 -1
  5. {pytest_deduplicate-0.2.0 → pytest_deduplicate-0.2.1}/LICENSE +0 -0
  6. {pytest_deduplicate-0.2.0 → pytest_deduplicate-0.2.1}/README.md +0 -0
  7. {pytest_deduplicate-0.2.0 → pytest_deduplicate-0.2.1}/pytest_deduplicate.egg-info/SOURCES.txt +0 -0
  8. {pytest_deduplicate-0.2.0 → pytest_deduplicate-0.2.1}/pytest_deduplicate.egg-info/dependency_links.txt +0 -0
  9. {pytest_deduplicate-0.2.0 → pytest_deduplicate-0.2.1}/pytest_deduplicate.egg-info/entry_points.txt +0 -0
  10. {pytest_deduplicate-0.2.0 → pytest_deduplicate-0.2.1}/pytest_deduplicate.egg-info/requires.txt +0 -0
  11. {pytest_deduplicate-0.2.0 → pytest_deduplicate-0.2.1}/pytest_deduplicate.egg-info/top_level.txt +0 -0
  12. {pytest_deduplicate-0.2.0 → pytest_deduplicate-0.2.1}/pytest_deduplicate.py +0 -0
  13. {pytest_deduplicate-0.2.0 → pytest_deduplicate-0.2.1}/pytest_deduplicate_artifacts.py +0 -0
  14. {pytest_deduplicate-0.2.0 → pytest_deduplicate-0.2.1}/pytest_deduplicate_checks.py +0 -0
  15. {pytest_deduplicate-0.2.0 → pytest_deduplicate-0.2.1}/pytest_deduplicate_index.py +0 -0
  16. {pytest_deduplicate-0.2.0 → pytest_deduplicate-0.2.1}/pytest_deduplicate_review.py +0 -0
  17. {pytest_deduplicate-0.2.0 → pytest_deduplicate-0.2.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest_deduplicate
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Reports observed test coverage overlap with optional stability and mutation checks
5
5
  Author-email: xor2003 <xor2003@gmx.com>
6
6
  License: GPL
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pytest_deduplicate"
7
- version = "0.2.0"
7
+ version = "0.2.1"
8
8
  description = "Reports observed test coverage overlap with optional stability and mutation checks"
9
9
  authors = [
10
10
  {name = "xor2003", email = "xor2003@gmx.com"},
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest_deduplicate
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Reports observed test coverage overlap with optional stability and mutation checks
5
5
  Author-email: xor2003 <xor2003@gmx.com>
6
6
  License: GPL
@@ -184,6 +184,18 @@ def import_coverage(plugin, coverage_file, manifest_file):
184
184
  continue
185
185
  excluded = set(manifest['excluded_test_lines'].get(str(path), []))
186
186
  scoped_files.append((filename, str(path), excluded))
187
+ files_by_context = {}
188
+ for file_info in scoped_files:
189
+ filename, _, _ = file_info
190
+ # Line contexts omit arcs with no positive endpoint (for example, an
191
+ # empty code object). Keep those files eligible in every context.
192
+ if any(start <= 0 and end <= 0 for start, end in data.arcs(filename) or []):
193
+ file_contexts = contexts
194
+ else:
195
+ file_contexts = {context for values in data.contexts_by_lineno(filename).values()
196
+ for context in values}
197
+ for context in file_contexts:
198
+ files_by_context.setdefault(context, []).append(file_info)
187
199
  for test in observations:
188
200
  phases = test['phases']
189
201
  if set(phases) != {'setup', 'call', 'teardown'}:
@@ -200,7 +212,7 @@ def import_coverage(plugin, coverage_file, manifest_file):
200
212
  continue
201
213
  data.set_query_context(context)
202
214
  arcs_by_file = {}
203
- for filename, path, excluded in scoped_files:
215
+ for filename, path, excluded in files_by_context.get(context, ()):
204
216
  arcs = {arc for arc in data.arcs(filename) or [] if not any(abs(n) in excluded for n in arc)}
205
217
  if arcs:
206
218
  arcs_by_file[path] = arcs