Skip to content

fix: resolve failing test, 50 ruff lint errors, and missing pytest-cov dependency#159

Merged
tirth8205 merged 1 commit intotirth8205:mainfrom
badgers4018:fix/tests-lint-dependencies
Apr 11, 2026
Merged

fix: resolve failing test, 50 ruff lint errors, and missing pytest-cov dependency#159
tirth8205 merged 1 commit intotirth8205:mainfrom
badgers4018:fix/tests-lint-dependencies

Conversation

@badgers4018
Copy link
Copy Markdown
Contributor

Summary

  • Failing test fix (test_imports_from_cells): The sample_notebook.ipynb fixture was missing import statements (os, pathlib, math) that the test expected to find as IMPORTS_FROM edges. Added import os and from pathlib import Path to cell 1 (alongside existing magic lines) and import math to cell 2, preserving all existing cell index assertions.

  • Ruff lint errors (50 total): Auto-fixed 12 errors (import sorting in test_tools.py, unused shutil import, trailing newline in fixture). Configured proper exclusions and per-file-ignores for the remaining 38 errors:

    • Excluded diagrams/ directory — DSL scripts use intentionally compact, non-standard style (semicolons, single-letter function names, long lines)
    • Excluded sample_databricks_notebook.ipynb — SQL/R/Scala cells produce syntax errors when parsed as Python
    • Per-file-ignores for sample_databricks_export.py (unused variable, trailing newline in fixture)
    • Per-file-ignores for sample_notebook.ipynb (intentionally unused imports, cross-cell import blocks)
    • Per-file-ignores for test_multilang.py (long assertion lines with explanatory comments)
  • Missing dependency: Added pytest-cov to the [project.optional-dependencies] dev group, required for --cov coverage reporting.

Test plan

  • All 620 tests pass (pytest — 620 passed, 2 xpassed)
  • ruff check . reports zero errors
  • test_imports_from_cells specifically passes with correct import targets
  • test_cell_index_tracking still passes (cell indices unchanged)
  • test_skips_magic_commands still passes (magic line filtering unaffected)

🤖 Generated with Claude Code

1. Fix test_imports_from_cells: The sample_notebook.ipynb fixture was
   missing import statements (os, pathlib, math) that the test expected.
   Added imports to cells 1 and 2 of the fixture.

2. Fix 50 ruff lint errors: Auto-fixed 12 errors (import sorting, unused
   imports in test files). Configured per-file-ignores and exclusions for
   the remaining errors in diagram DSL scripts (intentionally compact
   style), Databricks notebook fixtures (SQL/R/Scala syntax), and test
   fixture files.

3. Add pytest-cov to dev dependencies: Required for coverage reporting
   but was not declared in pyproject.toml optional dependencies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tirth8205 tirth8205 merged commit 51d3e8b into tirth8205:main Apr 11, 2026
1 check passed
tirth8205 added a commit that referenced this pull request Apr 11, 2026
Unreleased fixes since v2.2.2 that users are complaining about:
- #208 Claude Code hook schema (fixes #97, #138, #163, #168, #172, #182,
  #188, #191, #201) — v2.2.2 generates an invalid hooks schema and
  timeouts in ms instead of seconds; PreCommit is also not a real event.
- #205 SQLite transaction nesting (fixes #110, #135, #181) — implicit
  transactions from the legacy sqlite3 default caused "cannot start a
  transaction within a transaction" on update.
- #166 Go method receivers resolved from field_identifier.
- #170 UTF-8 decode errors in detect_changes (fixes #169).
- #142 --platform target filters (fixes #133).
- #213 / #183 large-repo community detection hangs.
- #220 CI lint + tomllib on Python 3.10.
- #159 missing pytest-cov dev dep.
- #154 JSX component CALLS edges.

Plus features: #177 Codex, #165 Luau (#153), #217 REFERENCES edge,
#215 recurse_submodules, #185 gitignore default (#175), #171 gitignore
docs (#157).

Verified locally on Python 3.11: ruff clean, mypy clean, bandit clean,
691 tests pass, coverage 73.72%.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tirth8205 tirth8205 mentioned this pull request Apr 11, 2026
5 tasks
tirth8205 added a commit that referenced this pull request Apr 11, 2026
Unreleased fixes since v2.2.2 that users are complaining about:
- #208 Claude Code hook schema (fixes #97, #138, #163, #168, #172, #182,
  #188, #191, #201) — v2.2.2 generates an invalid hooks schema and
  timeouts in ms instead of seconds; PreCommit is also not a real event.
- #205 SQLite transaction nesting (fixes #110, #135, #181) — implicit
  transactions from the legacy sqlite3 default caused "cannot start a
  transaction within a transaction" on update.
- #166 Go method receivers resolved from field_identifier.
- #170 UTF-8 decode errors in detect_changes (fixes #169).
- #142 --platform target filters (fixes #133).
- #213 / #183 large-repo community detection hangs.
- #220 CI lint + tomllib on Python 3.10.
- #159 missing pytest-cov dev dep.
- #154 JSX component CALLS edges.

Plus features: #177 Codex, #165 Luau (#153), #217 REFERENCES edge,
#215 recurse_submodules, #185 gitignore default (#175), #171 gitignore
docs (#157).

Verified locally on Python 3.11: ruff clean, mypy clean, bandit clean,
691 tests pass, coverage 73.72%.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants