8000 changed test_hash_changes unittest so it works with python 3.8 · nipype/pydra@fe3373f · GitHub
[go: up one dir, main page]

Skip to content

Commit fe3373f

Browse files
committed
changed test_hash_changes unittest so it works with python 3.8
1 parent 7c14e24 commit fe3373f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pydra/engine/tests/test_submitter.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
from dateutil import parser
2-
import random
2+
import secrets
33
import re
44
import subprocess as sp
5-
import struct
65
import time
76
import attrs
87
import typing as ty
@@ -595,11 +594,10 @@ class Unstable:
595594

596595
def __bytes_repr__(self, cache) -> ty.Iterator[bytes]:
597596
"""Random 128-bit bytestring"""
598-
yield random.randbytes(16)
597+
yield secrets.token_bytes(16)
599598

600599
@mark.task
601600
def unstable_input(unstable: Unstable) -> int:
602-
time.sleep(1) # Ensure the timestamp changes during the task run
603601
return unstable.value
604602

605603
task = unstable_input(unstable=Unstable(1))

0 commit comments

Comments
 (0)
0