File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ def test_display_formatter_active_types_config():
6262 from traitlets .config import Config
6363
6464 # Clear HistoryManager instances to bypass singleton limit before creating new shell
65+ prev_instances = HistoryManager ._instances .copy ()
6566 HistoryManager ._instances .clear ()
6667
6768 try :
@@ -73,8 +74,13 @@ def test_display_formatter_active_types_config():
7374 active_types = ip .display_formatter .active_types
7475 assert "text/plain" in active_types
7576 assert "image/png" in active_types
77+
78+ # Ensure only the expected types are active
79+ assert set (active_types ) == {"text/plain" , "image/png" }
7680 finally :
81+ # Clean up the new instance and restore previous state
7782 HistoryManager ._instances .clear ()
83+ HistoryManager ._instances .update (prev_instances )
7884
7985
8086def test_pretty ():
You can’t perform that action at this time.
0 commit comments