From d3c0381e34af35197578d6360a3c55e42320f61b Mon Sep 17 00:00:00 2001 From: Kodjo Sossouvi Date: Sun, 22 Mar 2026 08:37:07 +0100 Subject: [PATCH] Fixed unit tests ! --- src/myfasthtml/test/matcher.py | 6 ++++++ tests/controls/test_profiler.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/myfasthtml/test/matcher.py b/src/myfasthtml/test/matcher.py index 1581a19..05536c6 100644 --- a/src/myfasthtml/test/matcher.py +++ b/src/myfasthtml/test/matcher.py @@ -72,6 +72,12 @@ class EndsWith(AttrPredicate): class Contains(AttrPredicate): def __init__(self, *value, _word=False): + """ + Initializes the instance with the given value and optional private attribute `_word`. + + :param value: + :param _word: Matches the entire word if True, otherwise matches any substring. + """ super().__init__(value) self._word = _word diff --git a/tests/controls/test_profiler.py b/tests/controls/test_profiler.py index d54659f..5db1c50 100644 --- a/tests/controls/test_profiler.py +++ b/tests/controls/test_profiler.py @@ -196,7 +196,7 @@ class TestProfilerRender: trace_list = profiler_control._mk_trace_list() - cmd_spans = find(trace_list, Span("NavigateCell", cls=Contains("mf-profiler-cmd"))) + cmd_spans = find(trace_list, Span("NavigateCell", cls=Contains("mf-profiler-cmd", _word=True))) assert len(cmd_spans) == 1, "Command name should appear exactly once in the trace list" ts_spans = find(trace_list, Span(ts_expected, cls=Contains("mf-profiler-ts")))