@@ -349,7 +349,7 @@ def test_send_file_xsendfile(self, catch_deprecation_warnings):
349
349
assert rv .mimetype == 'text/html'
350
350
rv .close ()
351
351
352
- def test_send_file_object (self , recwarn ):
352
+ def test_send_file_object (self ):
353
353
app = flask .Flask (__name__ )
354
354
355
355
with app .test_request_context ():
@@ -361,10 +361,6 @@ def test_send_file_object(self, recwarn):
361
361
assert rv .mimetype == 'text/html'
362
362
rv .close ()
363
363
364
- # mimetypes + etag
365
- recwarn .pop (DeprecationWarning )
366
- recwarn .pop (DeprecationWarning )
367
-
368
364
app .use_x_sendfile = True
369
365
370
366
with app .test_request_context ():
@@ -376,10 +372,6 @@ def test_send_file_object(self, recwarn):
376
372
os .path .join (app .root_path , 'static/index.html' )
377
373
rv .close ()
378
374
379
- # mimetypes + etag
380
- recwarn .pop (DeprecationWarning )
381
- recwarn .pop (DeprecationWarning )
382
-
383
375
app .use_x_sendfile = False
384
376
with app .test_request_context ():
385
377
f = StringIO ('Test' )
@@ -389,9 +381,6 @@ def test_send_file_object(self, recwarn):
389
381
assert rv .mimetype == 'application/octet-stream'
390
382
rv .close ()
391
383
392
- # etags
393
- recwarn .pop (DeprecationWarning )
394
-
395
384
class PyStringIO (object ):
396
385
def __init__ (self , * args , ** kwargs ):
397
386
self ._io = StringIO (* args , ** kwargs )
@@ -405,21 +394,13 @@ def __getattr__(self, name):
405
394
assert rv .mimetype == 'text/plain'
406
395
rv .close ()
407
396
408
- # attachment_filename and etags
409
- a = recwarn .pop (DeprecationWarning )
410
- b = recwarn .pop (DeprecationWarning )
411
- c = recwarn .pop (UserWarning ) # file not found
412
-
413
397
f = StringIO ('Test' )
414
398
rv = flask .send_file (f , mimetype = 'text/plain' )
415
399
rv .direct_passthrough = False
416
400
assert rv .data == b'Test'
417
401
assert rv .mimetype == 'text/plain'
418
402
rv .close ()
419
403
420
- # etags
421
- recwarn .pop (DeprecationWarning )
422
-
423
404
app .use_x_sendfile = True
424
405
425
406
with app .test_request_context ():
@@ -428,10 +409,7 @@ def __getattr__(self, name):
428
409
assert 'x-sendfile' not in rv .headers
429
410
rv .close ()
430
411
431
- # etags
432
- recwarn .pop (DeprecationWarning )
433
-
434
- def test_attachment (self , recwarn ):
412
+ def test_attachment (self ):
435
413
app = flask .Flask (__name__ )
436
414
with app .test_request_context ():
437
415
with open (os .path .join (app .root_path , 'static/index.html' )) as f :
@@ -441,10 +419,6 @@ def test_attachment(self, recwarn):
441
419
assert value == 'attachment'
442
420
rv .close ()
443
421
444
- # mimetypes + etag
445
- assert len (recwarn .list ) == 2
446
- recwarn .clear ()
447
-
448
422
with app .test_request_context ():
449
423
assert options ['filename' ] == 'index.html'
450
424
rv = flask .send_file ('static/index.html' , as_attachment = True )
0 commit comments