From 179a6841fcb2fb7875e1629bc7afb81b6c23aea6 Mon Sep 17 00:00:00 2001 From: tligui_y Date: Tue, 5 Aug 2025 14:25:21 +0200 Subject: [PATCH] Update tests/test_utils_richcfg.py --- tests/test_utils_richcfg.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/test_utils_richcfg.py b/tests/test_utils_richcfg.py index fbf0ba38..280cf4f6 100644 --- a/tests/test_utils_richcfg.py +++ b/tests/test_utils_richcfg.py @@ -88,20 +88,17 @@ def test_rich_inspector_outputs_more_than_builtin(monkeypatch): # role = 'admin' assert "age = 30" in rich_text assert "name = 'Alice'" in rich_text - assert "role = 'admin'" in rich_text # Built-in inspector does NOT show instance values assert "30" not in builtin_text assert "Alice" not in builtin_text - assert "admin" not in builtin_text # # Built-in inspector only shows the brut init function assert "def __init__(self, name: str, age: int):" in builtin_text assert "self.name = name" in builtin_text assert "self.age = age" in builtin_text - - # Both outputs include the same method and documentation + # Both outputs include the same method and documentation and gives us the texts written outside functions # Method name is visible in both assert "def greet():" in rich_text @@ -111,6 +108,10 @@ def test_rich_inspector_outputs_more_than_builtin(monkeypatch): assert "Returns a welcome message." in rich_text assert "Returns a welcome message." in builtin_text + # Informations outside functions are visible in both + assert "role = 'admin'" in rich_text + assert "role = 'admin'" in builtin_text + # Class docstring is shown in both assert "Represents a user in the system." in rich_text assert "Represents a user in the system." in builtin_text