@@ -248,7 +248,8 @@ def check_text(html, help_txt, txt_number=0, threshold=0.95):
248
248
for element in ["<pre>" , "<span>" , "</span>" , "</pre>" ]:
249
249
txt = txt .strip (element )
250
250
assert txt is not None
251
- assert similarity (txt , help_txt ) > threshold
251
+ sim = similarity (txt , help_txt )
252
+ assert sim > threshold , f"{ sim } is below threshold { threshold } "
252
253
return txt
253
254
254
255
@@ -579,6 +580,11 @@ def test_click_ex_imagepipe():
579
580
580
581
581
582
def test_typer_ex_composite ():
583
+ EX_DIR = TYPER_EXAMPLES / "composite/composite"
584
+ cli_py = EX_DIR / "cli.py"
585
+ group_py = EX_DIR / "group.py"
586
+ echo_py = EX_DIR / "echo.py"
587
+
582
588
try :
583
589
clear_callbacks ()
584
590
@@ -609,7 +615,6 @@ def test_build(first=False):
609
615
610
616
return doc_helps
611
617
612
- EX_DIR = TYPER_EXAMPLES / "composite/composite"
613
618
index_html = TYPER_EXAMPLES / "composite/build/html/index.html"
614
619
composite_html = TYPER_EXAMPLES / "composite/build/html/composite.html"
615
620
echo_html = TYPER_EXAMPLES / "composite/build/html/echo.html"
@@ -631,10 +636,6 @@ def test_build(first=False):
631
636
times2 = [pth .stat ().st_mtime for pth in files ]
632
637
assert times == times2 , "Rebuild was not cached!"
633
638
634
- cli_py = EX_DIR / "cli.py"
635
- group_py = EX_DIR / "group.py"
636
- echo_py = EX_DIR / "echo.py"
637
-
638
639
# test that
639
640
replace_in_file (
640
641
cli_py , "Lets do stuff with strings." , "XX Lets do stuff with strings. XX"
0 commit comments