tests: Use proper random object for string generation
PyOCF needs to control random seed, to allow running tests with pytest-xdist. Use local random object initialized with seed from the config. Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
parent
64a46a78cb
commit
2560aa709c
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright(c) 2019-2021 Intel Corporation
|
# Copyright(c) 2019-2023 Intel Corporation
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
#
|
#
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ class RandomStringGenerator:
|
|||||||
*extra_chars,
|
*extra_chars,
|
||||||
]:
|
]:
|
||||||
yield "".join(
|
yield "".join(
|
||||||
random.choice(t)
|
self.random.choice(t)
|
||||||
for _ in range(self.random.randint(len_range.min, len_range.max))
|
for _ in range(self.random.randint(len_range.min, len_range.max))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user