Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bckohan committed Aug 18, 2024
1 parent 5cd07e9 commit f936d7c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ def check_text(html, help_txt, txt_number=0, threshold=0.95):
for element in ["<pre>", "<span>", "</span>", "</pre>"]:
txt = txt.strip(element)
assert txt is not None
assert similarity(txt, help_txt) > threshold
sim = similarity(txt, help_txt)
assert sim > threshold, f"{sim} is below threshold {threshold}"
return txt


Expand Down Expand Up @@ -579,6 +580,11 @@ def test_click_ex_imagepipe():


def test_typer_ex_composite():
EX_DIR = TYPER_EXAMPLES / "composite/composite"
cli_py = EX_DIR / "cli.py"
group_py = EX_DIR / "group.py"
echo_py = EX_DIR / "echo.py"

try:
clear_callbacks()

Expand Down Expand Up @@ -609,7 +615,6 @@ def test_build(first=False):

return doc_helps

EX_DIR = TYPER_EXAMPLES / "composite/composite"
index_html = TYPER_EXAMPLES / "composite/build/html/index.html"
composite_html = TYPER_EXAMPLES / "composite/build/html/composite.html"
echo_html = TYPER_EXAMPLES / "composite/build/html/echo.html"
Expand All @@ -631,10 +636,6 @@ def test_build(first=False):
times2 = [pth.stat().st_mtime for pth in files]
assert times == times2, "Rebuild was not cached!"

cli_py = EX_DIR / "cli.py"
group_py = EX_DIR / "group.py"
echo_py = EX_DIR / "echo.py"

# test that
replace_in_file(
cli_py, "Lets do stuff with strings.", "XX Lets do stuff with strings. XX"
Expand Down

0 comments on commit f936d7c

Please sign in to comment.