@@ -127,24 +127,24 @@ def test_legacy_rewriter_leaves_serve_flag_unchanged(self):
127127 assert is_legacy is False
128128
129129 def test_legacy_emits_deprecation_warning (self ):
130- cli_module ._LEGACY_WARNING_EMITTED = False
130+ cli_module ._LEGACY_WARNING_EVENTS . clear ()
131131 with warnings .catch_warnings (record = True ) as caught :
132132 warnings .simplefilter ("always" )
133133 cli_module ._emit_legacy_deprecation_warning ("run" )
134134 assert any (issubclass (w .category , DeprecationWarning ) for w in caught )
135135 assert any ("audit run" in str (w .message ) for w in caught )
136- cli_module ._LEGACY_WARNING_EMITTED = False
136+ cli_module ._LEGACY_WARNING_EVENTS . clear ()
137137
138138 def test_legacy_warning_emits_once (self ):
139- cli_module ._LEGACY_WARNING_EMITTED = False
139+ cli_module ._LEGACY_WARNING_EVENTS . clear ()
140140 with warnings .catch_warnings (record = True ) as caught :
141141 warnings .simplefilter ("always" )
142142 cli_module ._emit_legacy_deprecation_warning ("run" )
143143 cli_module ._emit_legacy_deprecation_warning ("run" )
144144 cli_module ._emit_legacy_deprecation_warning ("triage" )
145145 deprecations = [w for w in caught if issubclass (w .category , DeprecationWarning )]
146146 assert len (deprecations ) == 1
147- cli_module ._LEGACY_WARNING_EMITTED = False
147+ cli_module ._LEGACY_WARNING_EVENTS . clear ()
148148
149149 def test_legacy_skip_forks (self ):
150150 args = _parse_legacy ("myuser" , "--skip-forks" )
0 commit comments