@@ -13,12 +13,12 @@ def config(config):
1313 return config
1414
1515
16- @pytest .mark .gen_test
17- def test_crop (mocker , http_client , base_url ):
16+ @pytest .mark .asyncio
17+ async def test_crop (mocker , http_client , base_url ):
1818 mocker .spy (FFmpegEngine , 'crop' )
1919 mocker .spy (FFmpegEngine , 'run_cmd' )
2020
21- response = yield http_client .fetch ("%s/unsafe/50x25:150x125/hotdog.mp4" % base_url )
21+ response = await http_client .fetch ("%s/unsafe/50x25:150x125/hotdog.mp4" % base_url )
2222
2323 assert response .code == 200
2424 assert response .headers .get ('content-type' ) == 'video/mp4'
@@ -35,12 +35,12 @@ def test_crop(mocker, http_client, base_url):
3535 assert (file_info ['width' ], file_info ['height' ]) == (100 , 100 )
3636
3737
38- @pytest .mark .gen_test
39- def test_flip_horizontally (mocker , http_client , base_url ):
38+ @pytest .mark .asyncio
39+ async def test_flip_horizontally (mocker , http_client , base_url ):
4040 mocker .spy (FFmpegEngine , 'flip_horizontally' )
4141 mocker .spy (FFmpegEngine , 'run_cmd' )
4242
43- response = yield http_client .fetch ("%s/unsafe/-200x150/hotdog.mp4" % base_url )
43+ response = await http_client .fetch ("%s/unsafe/-200x150/hotdog.mp4" % base_url )
4444
4545 assert response .code == 200
4646 assert response .headers .get ('content-type' ) == 'video/mp4'
@@ -57,12 +57,12 @@ def test_flip_horizontally(mocker, http_client, base_url):
5757 assert (file_info ['width' ], file_info ['height' ]) == (200 , 150 )
5858
5959
60- @pytest .mark .gen_test
61- def test_flip_vertically (mocker , http_client , base_url ):
60+ @pytest .mark .asyncio
61+ async def test_flip_vertically (mocker , http_client , base_url ):
6262 mocker .spy (FFmpegEngine , 'flip_vertically' )
6363 mocker .spy (FFmpegEngine , 'run_cmd' )
6464
65- response = yield http_client .fetch ("%s/unsafe/200x-150/hotdog.mp4" % base_url )
65+ response = await http_client .fetch ("%s/unsafe/200x-150/hotdog.mp4" % base_url )
6666
6767 assert response .code == 200
6868 assert response .headers .get ('content-type' ) == 'video/mp4'
@@ -79,12 +79,12 @@ def test_flip_vertically(mocker, http_client, base_url):
7979 assert (file_info ['width' ], file_info ['height' ]) == (200 , 150 )
8080
8181
82- @pytest .mark .gen_test
83- def test_filter_grayscale (mocker , http_client , base_url ):
82+ @pytest .mark .asyncio
83+ async def test_filter_grayscale (mocker , http_client , base_url ):
8484 mocker .spy (FFmpegEngine , 'convert_to_grayscale' )
8585 mocker .spy (FFmpegEngine , 'run_cmd' )
8686
87- response = yield http_client .fetch ("%s/unsafe/filters:grayscale()/hotdog.mp4" % base_url )
87+ response = await http_client .fetch ("%s/unsafe/filters:grayscale()/hotdog.mp4" % base_url )
8888
8989 assert response .code == 200
9090 assert response .headers .get ('content-type' ) == 'video/mp4'
@@ -101,12 +101,12 @@ def test_filter_grayscale(mocker, http_client, base_url):
101101 assert (file_info ['width' ], file_info ['height' ]) == (200 , 150 )
102102
103103
104- @pytest .mark .gen_test
105- def test_filter_rotate (mocker , http_client , base_url ):
104+ @pytest .mark .asyncio
105+ async def test_filter_rotate (mocker , http_client , base_url ):
106106 mocker .spy (FFmpegEngine , 'rotate' )
107107 mocker .spy (FFmpegEngine , 'run_cmd' )
108108
109- response = yield http_client .fetch ("%s/unsafe/filters:rotate(90)/hotdog.mp4" % base_url )
109+ response = await http_client .fetch ("%s/unsafe/filters:rotate(90)/hotdog.mp4" % base_url )
110110
111111 assert response .code == 200
112112 assert response .headers .get ('content-type' ) == 'video/mp4'
@@ -123,14 +123,14 @@ def test_filter_rotate(mocker, http_client, base_url):
123123 assert (file_info ['width' ], file_info ['height' ]) == (200 , 150 )
124124
125125
126- @pytest .mark .gen_test
127- def test_reorientate (mocker , config , http_client , base_url ):
126+ @pytest .mark .asyncio
127+ async def test_reorientate (mocker , config , http_client , base_url ):
128128 config .RESPECT_ORIENTATION = True
129129
130130 mocker .spy (FFmpegEngine , 'reorientate' )
131131 mocker .spy (FFmpegEngine , 'run_cmd' )
132132
133- response = yield http_client .fetch ("%s/unsafe/hotdog.mp4" % base_url )
133+ response = await http_client .fetch ("%s/unsafe/hotdog.mp4" % base_url )
134134
135135 assert response .code == 200
136136 assert response .headers .get ('content-type' ) == 'video/mp4'
0 commit comments