Claude Code Bot Claude Opus 4.5 commited on
Commit
3addb72
·
1 Parent(s): e3e6842

fix(tests): skip HTML extractor tests when trafilatura not installed

Browse files

Add pytest.importorskip("trafilatura") to HTML extractor test modules
to skip tests gracefully when the optional trafilatura dependency is
not installed. This fixes CI failures in the base test matrix that
doesn't include the html extras.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

tests/test_evals/test_html_extraction_eval.py CHANGED
@@ -14,6 +14,9 @@ import os
14
 
15
  import pytest
16
 
 
 
 
17
  from headroom.evals.html_extraction import (
18
  HTMLEvalCase,
19
  HTMLEvalResult,
 
14
 
15
  import pytest
16
 
17
+ # Skip entire module if trafilatura not installed
18
+ pytest.importorskip("trafilatura")
19
+
20
  from headroom.evals.html_extraction import (
21
  HTMLEvalCase,
22
  HTMLEvalResult,
tests/test_evals/test_html_oss_benchmarks.py CHANGED
@@ -21,6 +21,9 @@ import os
21
 
22
  import pytest
23
 
 
 
 
24
 
25
  class TestExtractionBenchmark:
26
  """Tests using Scrapinghub Article Extraction Benchmark.
 
21
 
22
  import pytest
23
 
24
+ # Skip entire module if trafilatura not installed
25
+ pytest.importorskip("trafilatura")
26
+
27
 
28
  class TestExtractionBenchmark:
29
  """Tests using Scrapinghub Article Extraction Benchmark.
tests/test_transforms/test_html_extractor.py CHANGED
@@ -7,6 +7,9 @@ and removes structural noise.
7
 
8
  import pytest
9
 
 
 
 
10
  from headroom.transforms.html_extractor import (
11
  HTMLExtractionResult,
12
  HTMLExtractor,
 
7
 
8
  import pytest
9
 
10
+ # Skip entire module if trafilatura not installed
11
+ pytest.importorskip("trafilatura")
12
+
13
  from headroom.transforms.html_extractor import (
14
  HTMLExtractionResult,
15
  HTMLExtractor,