Skip to content

Commit 75e8c51

Browse files
authored
test: improve test coverage to 90%+ (#5)
* test: improve test coverage to 90%+ Expand test suite from 17 tests (22% coverage) to 269 tests (94% coverage). New test files: - test_link_traverser.py (~50 tests) - test_report_generator.py (22 tests) - test_visual_comparison.py (~57 tests) Rewritten test files with comprehensive coverage: - test_cli.py (38 tests) - test_diff_engine.py (41 tests) - test_fetcher.py (16 tests) - test_wayback_cleaner.py (26 tests) Bug fixes found during testing: - diff_engine.py: fix compare_structures TypeError on Python 3.14 (SequenceMatcher rejects unhashable dict elements) - wayback_cleaner.py: fix remove_wayback_header fallback path skipping content past the meta tag boundary * fix(ci): add Pillow to requirements.txt visual_comparison.py imports PIL which requires Pillow. It was in setup.py but not in requirements.txt used by CI. * fix: add future annotations import for lazy type evaluation Resolves NameError when selenium is not installed by making type annotations lazily evaluated via __future__.annotations. * fix: add selenium to dev dependencies for visual comparison tests Tests import selenium directly (TimeoutException, webdriver mock targets), so it must be present in the test environment. * fix: add webdriver-manager and numpy to dev dependencies Tests mock ChromeDriverManager/GeckoDriverManager and import numpy directly, so both must be present in the test environment.
1 parent 5e09d17 commit 75e8c51

12 files changed

Lines changed: 3505 additions & 135 deletions

requirements-dev.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
pytest>=7.4.0
22
pytest-cov>=4.1.0
33
pytest-mock>=3.11.0
4+
selenium>=4.10.0
5+
webdriver-manager>=4.0.0
6+
numpy>=1.24.0

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
requests>=2.31.0
22
beautifulsoup4>=4.12.0
33
lxml>=4.9.0
4+
Pillow>=10.0.0

tests/test_cli.py

Lines changed: 667 additions & 47 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)