File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change 16
16
from time import sleep
17
17
18
18
from _pytest .capture import CaptureFixture
19
+ import backoff
19
20
import google .auth .transport .requests
20
21
from google .cloud .api_keys_v2 import Key
21
22
import pytest
37
38
@pytest .fixture (scope = "module" )
38
39
def api_key ():
39
40
api_key = create_api_key .create_api_key (PROJECT )
40
- sleep (20 )
41
+ sleep (300 )
41
42
yield api_key
42
43
delete_api_key .delete_api_key (PROJECT , get_key_id (api_key .name ))
43
44
@@ -46,6 +47,8 @@ def get_key_id(api_key_name: str):
46
47
return api_key_name .rsplit ("/" )[- 1 ]
47
48
48
49
50
+ @backoff .on_exception (backoff .expo ,
51
+ Exception , max_tries = 3 )
49
52
def test_authenticate_with_api_key (api_key : Key , capsys : CaptureFixture ):
50
53
authenticate_with_api_key .authenticate_with_api_key (PROJECT , api_key .key_string )
51
54
out , err = capsys .readouterr ()
Original file line number Diff line number Diff line change 1
1
pytest==7.1.2
2
2
mock==4.0.3
3
+ backoff==2.2.1
You can’t perform that action at this time.
0 commit comments