summaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/common/test_framework/test_utils.py
diff options
context:
space:
mode:
authorrobot-piglet <[email protected]>2024-12-24 23:49:23 +0300
committerrobot-piglet <[email protected]>2024-12-25 00:01:38 +0300
commita227b54ce2fdd48f2fe9e0eb6a93e79055631284 (patch)
tree1ae2c72696c568040408a88f57b3a1357b3fd18c /yql/essentials/tests/common/test_framework/test_utils.py
parentf5146f15b473fbf5a19b782af7fde119ace0024b (diff)
Intermediate changes
commit_hash:590e82994e20a092dbe0ab18b8d2fd0fd6fc4dab
Diffstat (limited to 'yql/essentials/tests/common/test_framework/test_utils.py')
-rw-r--r--yql/essentials/tests/common/test_framework/test_utils.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/yql/essentials/tests/common/test_framework/test_utils.py b/yql/essentials/tests/common/test_framework/test_utils.py
index 353bcced5c1..0c02633558b 100644
--- a/yql/essentials/tests/common/test_framework/test_utils.py
+++ b/yql/essentials/tests/common/test_framework/test_utils.py
@@ -1,7 +1,9 @@
import json
import os
+import six
import re
import yatest.common
+import zlib
from yql_utils import get_param as yql_get_param
from google.protobuf import text_format
@@ -19,6 +21,12 @@ except BaseException:
YQLRUN_PATH = None
+def _make_hash(x):
+ if six.PY2:
+ return hash(x)
+ return zlib.crc32(repr(x).encode("utf-8"))
+
+
def get_sql_flags():
gateway_config = gateways_config_pb2.TGatewaysConfig()
@@ -86,9 +94,9 @@ def pytest_generate_tests_for_run(metafunc, template='.sql', suites=None, curren
if os.path.exists(suite_dir + '/' + case + '.cfg'):
configs.append('')
for cfg in sorted(configs):
- if hash((suite, case, cfg)) % partsCount == currentPart:
+ if _make_hash((suite, case, cfg)) % partsCount == currentPart:
argvalues.append((suite, case, cfg))
- if not configs and hash((suite, case, 'default.txt')) % partsCount == currentPart:
+ if not configs and _make_hash((suite, case, 'default.txt')) % partsCount == currentPart:
argvalues.append((suite, case, 'default.txt'))
metafunc.parametrize(