Merge pull request #769 from robertbaldyga/pyocf-fix-random-string

tests: Use proper random object for string generation
This commit is contained in:
Robert Baldyga 2023-04-17 20:37:38 +02:00 committed by GitHub
commit 83477bdcf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,5 @@
#
# Copyright(c) 2019-2021 Intel Corporation
# Copyright(c) 2019-2023 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
#
@ -79,7 +79,7 @@ class RandomStringGenerator:
*extra_chars,
]:
yield "".join(
random.choice(t)
self.random.choice(t)
for _ in range(self.random.randint(len_range.min, len_range.max))
)