summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/test_app_cleanup.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/test_app_cleanup.py b/tests/test_app_cleanup.py
index 5d5cb743..20f8fdac 100644
--- a/tests/test_app_cleanup.py
+++ b/tests/test_app_cleanup.py
@@ -21,8 +21,7 @@
import os
-import string
-import random
+import secrets
import multiprocessing
import multiprocessing.queues
import time
@@ -36,10 +35,7 @@ from kvmd.apps.cleanup import main
def test_main(tmpdir) -> None: # type: ignore
queue: multiprocessing.queues.Queue = multiprocessing.Queue()
- ustreamer_fake_name = "ustr-" + "".join(
- random.choice(string.ascii_lowercase + string.digits)
- for _ in range(5)
- )
+ ustreamer_fake_name = "ustr-" + secrets.token_hex(3)
ustreamer_sock_path = os.path.abspath(str(tmpdir.join("ustreamer-fake.sock")))
kvmd_sock_path = os.path.abspath(str(tmpdir.join("kvmd-fake.sock")))