Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace usage of easybuild.tools.py2vs3 in easyconfigs test suite #19744

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions test/easyconfigs/easyconfigs.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import tempfile
from collections import defaultdict
from unittest import TestCase, TestLoader, main, skip
from urllib.request import urlopen

import easybuild.main as eb_main
import easybuild.tools.options as eboptions
Expand All @@ -57,7 +58,6 @@
from easybuild.tools.filetools import verify_checksum, which, write_file
from easybuild.tools.module_naming_scheme.utilities import det_full_ec_version
from easybuild.tools.modules import modules_tool
from easybuild.tools.py2vs3 import string_type, urlopen
from easybuild.tools.robot import check_conflicts, resolve_dependencies
from easybuild.tools.run import run_cmd
from easybuild.tools.options import set_tmpdir
Expand Down Expand Up @@ -436,12 +436,12 @@ def check_dep_vars(self, gen, dep, dep_vars):
# always retain at least one dep variant
if len(dep_vars) == 1:
break
if isinstance(dep_name, string_type):
if isinstance(dep_name, str):
if dep != dep_name:
continue
elif dep not in dep_name:
continue
if isinstance(version_suffix, string_type):
if isinstance(version_suffix, str):
match_prefix = False
else:
version_suffix, match_prefix = version_suffix
Expand Down Expand Up @@ -1459,7 +1459,7 @@ def template_easyconfig_test(self, spec):
# check whether any entry in osdependencies related to OpenSSL
openssl_osdep = False
for osdep in osdeps:
if isinstance(osdep, string_type):
if isinstance(osdep, str):
osdep = [osdep]
if any('libssl' in x for x in osdep) or any('openssl' in x for x in osdep):
openssl_osdep = True
Expand Down Expand Up @@ -1628,7 +1628,7 @@ def template_easyconfig_test(self, spec):

# take into account that for some string-valued easyconfig parameters (configopts & co),
# the easyblock may have injected additional values, which affects the dumped easyconfig file
elif isinstance(orig_val, string_type):
elif isinstance(orig_val, str):
error_msg = "%s value '%s' should start with '%s'" % (key, dumped_val, orig_val)
self.assertTrue(dumped_val.startswith(orig_val), error_msg)
else:
Expand Down