File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -578,7 +578,7 @@ def _file_context_manager(filename_or_object, mode='r'):
578578 A file-like object to be used via python's "with [context] as buffer:"
579579 syntax.
580580 """
581-
581+
582582 if hasattr (filename_or_object , "read" ):
583583 # already a file-like object
584584 context = contextlib .nullcontext (filename_or_object )
Original file line number Diff line number Diff line change @@ -264,20 +264,20 @@ def test__file_context_manager():
264264 filename = os .path .join (td , 'test.txt' )
265265 with open (filename , 'w' ) as fh :
266266 fh .write ('test content' )
267-
267+
268268 # test with filename as string:
269269 with tools ._file_context_manager (filename ) as obj :
270270 assert obj .read () == "test content"
271-
271+
272272 # test with filename as Path:
273273 with tools ._file_context_manager (Path (filename )) as obj :
274274 assert obj .read () == "test content"
275-
275+
276276 # test with file object:
277277 with open (filename , "r" ) as f :
278278 with tools ._file_context_manager (f ) as obj :
279279 assert obj .read () == "test content"
280-
280+
281281 # test with buffer:
282282 buffer = StringIO ("test content" )
283283 with tools ._file_context_manager (buffer ) as obj :
You can’t perform that action at this time.
0 commit comments