File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 2
2
import contextlib
3
3
import logging
4
4
import os
5
- import tempfile
5
+ import random
6
6
import time
7
7
import warnings
8
- from typing import Callable , Optional
8
+ from typing import Callable , List , Optional
9
9
10
10
from .exc import WaitTimeout
11
11
15
15
RETRY_TIMEOUT_SECONDS = int (os .getenv ("RETRY_TIMEOUT_SECONDS" , 8 ))
16
16
RETRY_INTERVAL_SECONDS = float (os .getenv ("RETRY_INTERVAL_SECONDS" , 0.05 ))
17
17
18
- namer = tempfile ._RandomNameSequence ()
18
+
19
+ class RandomStrSequence :
20
+ def __init__ (self , characters : str = "abcdefghijklmnopqrstuvwxyz0123456789_" ):
21
+ self .characters : str = characters
22
+
23
+ def __iter__ (self ):
24
+ return self
25
+
26
+ def __next__ (self ):
27
+ return "" .join (random .sample (self .characters , k = 8 ))
28
+
29
+
30
+ namer = RandomStrSequence ()
19
31
current_dir = os .path .abspath (os .path .dirname (__file__ ))
20
32
example_dir = os .path .abspath (os .path .join (current_dir , ".." , "examples" ))
21
33
fixtures_dir = os .path .realpath (os .path .join (current_dir , "fixtures" ))
You can’t perform that action at this time.
0 commit comments