File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed
Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -219,15 +219,20 @@ def test_magics(tmp_path):
219219
220220 tmp_file = tmp_path / "test.txt"
221221 tmp_file .write_text ("hi" , "utf8" )
222- magics .edit (str (tmp_file ))
223- payload = shell .payload_manager .read_payload ()[0 ]
224- assert payload ["filename" ] == str (tmp_file )
225-
226- magics .clear ([])
227- magics .less (str (tmp_file ))
228- if os .name == "posix" :
229- magics .man ("ls" )
230- magics .autosave ("10" )
222+ # This should be fixed by https://github.com/ipython/ipython/pull/14749,
223+ # but may take some time to be released,
224+ # once old, enough remove this catch warnings.
225+ with warnings .catch_warnings ():
226+ warnings .filterwarnings ("ignore" , category = ResourceWarning , message = "unclosed file" )
227+ magics .edit (str (tmp_file ))
228+ payload = shell .payload_manager .read_payload ()[0 ]
229+ assert payload ["filename" ] == str (tmp_file )
230+
231+ magics .clear ([])
232+ magics .less (str (tmp_file ))
233+ if os .name == "posix" :
234+ magics .man ("ls" )
235+ magics .autosave ("10" )
231236
232237 socket .close ()
233238 context .destroy ()
You can’t perform that action at this time.
0 commit comments