From 5ff630bf21a52178dcebae7092a9052d8c04130b Mon Sep 17 00:00:00 2001 From: Lubomir Gallovic Date: Wed, 15 Apr 2020 16:12:17 +0200 Subject: [PATCH] Fix Python 3 testcases [CLOUDDST-27] After the automatically detected problems were fixed, the following issues had to be resolved to ensure that the whole test suite passes in Python 3: - in testcase 'test_get_state_with_error_other_than_enoent', '__builtin__' was changed to 'six.moves.builtins' because the built-in library was renamed in Python 3. - In Python 3, the bash command output is a bytes type, which can cause many issues since the code expects to work with a string. It was solved by decoding it as a UTF-8. This encoding was chosen because it is the most likely to be used by the invoked shell. The decoding is only done on Python 3 because the type would be changed to 'unicode' in Python 2, which is not desired either. --- alt_src/alt_src.py | 58 +++++++++++++++++++++++-------------------- tests/test_debrand.py | 15 +---------- tests/test_rpms.py | 48 +++++++---------------------------- 3 files changed, 41 insertions(+), 80 deletions(-) diff --git a/alt_src/alt_src.py b/alt_src/alt_src.py index 37ff7a8..aaa01c6 100644 --- a/alt_src/alt_src.py +++ b/alt_src/alt_src.py @@ -206,7 +206,7 @@ def setup_logfile(self, logname): if ntimes > 1024: raise SanityError("Too many log backups") fname = "%s.%d" % (fname_, ntimes) - self.logfile = file(fname, 'w') + self.logfile = open(fname, 'w') handler = logging.StreamHandler(self.logfile) handler.setFormatter(logging.Formatter(self.options.config['log_format'])) handler.setLevel(self.options.file_log_level) @@ -265,7 +265,7 @@ def get_output(self, cmd, fatal=True, **kwargs): if 'stderr' in kwargs: # convenience values if kwargs['stderr'] == 'null': - kwargs['stderr'] = file('/dev/null', 'w') + kwargs['stderr'] = open('/dev/null', 'w') elif kwargs['stderr'] == 'keep': kwargs['stderr'] = subprocess.STDOUT elif self.logfile: @@ -273,6 +273,10 @@ def get_output(self, cmd, fatal=True, **kwargs): kwargs['stderr'] = self.logfile proc = subprocess.Popen(cmd, **kwargs) output = proc.communicate()[0] + # we'll decode it only if it's bytes type (not a PY2 'str' type) + if not isinstance(output, str) and isinstance(output, bytes): + # we'll assume that bash uses utf-8 encoding + output = output.decode('utf-8') self.logger.debug("Command output was:\n%s", output) retval = proc.wait() if retval: @@ -805,7 +809,7 @@ def init_new_repo(self): cmd = ['git', 'clone', '--bare', initdir, "repo_init.git"] self.log_cmd(cmd, cwd=self.workdir) descfile = os.path.join(self.workdir, "repo_init.git", "description") - fobj = file(descfile, 'w') + fobj = open(descfile, 'w') fobj.write(self.summary) fobj.write('\n') fobj.close() @@ -813,7 +817,7 @@ def init_new_repo(self): # add gitblit options to git config # XXX this content should not be hard coded git_config = os.path.join(self.workdir, "repo_init.git", "config") - fobj = file(git_config, 'a') + fobj = open(git_config, 'a') params = { 'summary' : self.summary, 'package' : self.package, @@ -950,8 +954,8 @@ def import_sources(self): to_move.sort() # move files to lookaside - meta = file(os.path.join(dst, ".%s.metadata" % self.package), 'w') - gitignore = file(os.path.join(dst, ".gitignore"), 'w') + meta = open(os.path.join(dst, ".%s.metadata" % self.package), 'w') + gitignore = open(os.path.join(dst, ".gitignore"), 'w') for fname in to_move: path = os.path.join(sourcedir, fname) digest = self.get_digest(path) @@ -997,7 +1001,7 @@ def get_digest(self, path): """Calculate hex digest for file""" csum = hashlib.sha1() - fobj = file(path, 'rb') + fobj = open(path, 'rb') chunk = 'IGNORE ME!' while chunk: chunk = fobj.read(8192) @@ -1118,8 +1122,8 @@ def debrand(self): if self.for_lookaside(path): for_lookaside.append(fname) if for_lookaside: - meta = file(os.path.join(self.checkout, ".%s.metadata" % self.package), 'a') - gitignore = file(os.path.join(self.checkout, ".gitignore"), 'a') + meta = open(os.path.join(self.checkout, ".%s.metadata" % self.package), 'a') + gitignore = open(os.path.join(self.checkout, ".gitignore"), 'a') for fname in for_lookaside: path = os.path.join(self.checkout, fname) digest = self.get_digest(path) @@ -1167,7 +1171,7 @@ def handle_debrand_fail(self): self.logger.warning("Adding debranding failure notice") fname = os.path.join(self.checkout, "README.debrand") - fobj = file(fname, 'w') + fobj = open(fname, 'w') fobj.write('''\ Warning: This package was configured for automatic debranding, but the changes failed to apply. @@ -1202,7 +1206,7 @@ def prep_changelog(self, notes): parts.append('- %s\n' % line) else: parts.append('- %s\n' % line) - fobj = file(os.path.join(self.workdir, 'changelog.txt'), 'w') + fobj = open(os.path.join(self.workdir, 'changelog.txt'), 'w') for part in parts: fobj.write(part) self.logger.debug("%s", part) @@ -1279,7 +1283,7 @@ def rule_handler_re(self, data): fname = os.path.join(self.checkout, data['file']) else: fname = self.find_spec() - fobj = file(fname, 'r') + fobj = open(fname, 'r') text = fobj.read() fobj.close() count = int(data.get('count', '0')) @@ -1287,7 +1291,7 @@ def rule_handler_re(self, data): text = re.sub(data['match'], data['replace'], text, count) else: text = re.sub(data['match'], data['replace'], text) - fobj = file(fname, 'w') + fobj = open(fname, 'w') fobj.write(text) fobj.close() @@ -1329,7 +1333,7 @@ def handle_re_line(self, data): else: fname = self.find_spec() self.logger.info('Applying regex substitutions to %s', fname) - fobj = file(fname, 'r') + fobj = open(fname, 'r') lines = fobj.readlines() fobj.close() prog = re.compile(data['match']) @@ -1353,7 +1357,7 @@ def handle_re_line(self, data): else: self.logger.error('No matches for pattern %r', prog.pattern) # write it back out - fobj = file(fname, 'w') + fobj = open(fname, 'w') fobj.writelines(lines) fobj.close() @@ -1376,7 +1380,7 @@ def handle_add_patch(self, data): patchstrip = int(data.get('strip', '1')) self.logger.debug("Adding patch: %r", data) specfile = self.find_spec() - fobj = file(specfile, 'r') + fobj = open(specfile, 'r') lines = fobj.readlines() fobj.close() # find highest patch number and last patch line location @@ -1468,7 +1472,7 @@ def handle_add_patch(self, data): raise SanityError("Unable to apply patch %s" % patchname) # write it back out - fobj = file(specfile, 'w') + fobj = open(specfile, 'w') fobj.writelines(lines) fobj.close() @@ -1498,7 +1502,7 @@ def handle_rm_patch(self, data): raise SanityError('Invalid rule') specfile = self.find_spec() - fobj = file(specfile, 'r') + fobj = open(specfile, 'r') lines = fobj.readlines() fobj.close() @@ -1536,7 +1540,7 @@ def handle_rm_patch(self, data): raise SanityError("Unable to remove patch") # write it back out - fobj = file(specfile, 'w') + fobj = open(specfile, 'w') fobj.writelines(lines) fobj.close() @@ -1560,7 +1564,7 @@ def handle_add_source(self, data): sourcefile = os.path.join(self.options.config['rulesdir'], data['source']) sourcename = os.path.basename(sourcefile) specfile = self.find_spec() - fobj = file(specfile, 'r') + fobj = open(specfile, 'r') lines = fobj.readlines() fobj.close() @@ -1598,7 +1602,7 @@ def handle_add_source(self, data): self.copy_new_source(sourcefile) # write it back out - fobj = file(specfile, 'w') + fobj = open(specfile, 'w') fobj.writelines(lines) fobj.close() @@ -1608,7 +1612,7 @@ def handle_replace_source(self, data): sourcefile = os.path.join(self.options.config['rulesdir'], data['source']) sourcename = os.path.basename(sourcefile) specfile = self.find_spec() - fobj = file(specfile, 'r') + fobj = open(specfile, 'r') lines = fobj.readlines() fobj.close() @@ -1639,7 +1643,7 @@ def handle_replace_source(self, data): #TODO - option to remove old # write it back out - fobj = file(specfile, 'w') + fobj = open(specfile, 'w') fobj.writelines(lines) fobj.close() @@ -1732,7 +1736,7 @@ def add_changelog(self): self.log_cmd(['git', 'checkout', stage_branch], cwd=self.checkout) # get the changelog entry - fobj = file(fname, 'r') + fobj = open(fname, 'r') clog = fobj.read() now = datetime.datetime.now().strftime('%a %b %d %Y') if clog.find('INSERT_DATE_HERE') == -1: @@ -1743,7 +1747,7 @@ def add_changelog(self): # insert the entry into spec spec = self.find_spec() prog = re.compile(r'^(\s*%changelog.*)$', re.MULTILINE) - inf = file(spec, 'r') + inf = open(spec, 'r') parts = prog.split(inf.read()) inf.close() if len(parts) == 1: @@ -1752,7 +1756,7 @@ def add_changelog(self): elif len(parts) == 2: # should not be possible raise SanityError('Unable to split changelog from spec') - outf = file(spec, 'w') + outf = open(spec, 'w') for part in parts[:2]: outf.write(part) outf.write('\n') @@ -1924,7 +1928,7 @@ def init_pagure_remote_repo(self): def push_lookaside(self): - meta = file(os.path.join(self.checkout, ".%s.metadata" % self.package), 'r') + meta = open(os.path.join(self.checkout, ".%s.metadata" % self.package), 'r') for line in meta.readlines(): line = line.strip() digest, _ = line.split(None, 1) diff --git a/tests/test_debrand.py b/tests/test_debrand.py index e80121a..47fd5df 100644 --- a/tests/test_debrand.py +++ b/tests/test_debrand.py @@ -8,12 +8,7 @@ import pytest import yaml - -# ensure python2 before attempting to import sources -if sys.version_info < (3, 0): - from alt_src.alt_src import Stager - -xfail = pytest.mark.xfail(sys.version_info >= (3, 0), reason='Incompatible with python3') +from alt_src.alt_src import Stager TESTS_PATH = os.path.dirname(__file__) MODULES_PATH = os.path.join(TESTS_PATH, 'data', 'module_source') @@ -294,7 +289,6 @@ def spec_file(request, checkout_dir): yield fname -@xfail(strict=True) @pytest.fixture def stager_setup(request, read_source, rule_cfg, options, checkout_dir, spec_file, work_dir, rules_dir): @@ -323,7 +317,6 @@ def stager_setup_mmd_params(modname, branch, rule_cfg): {'fname': modname}) -@xfail(strict=True) @pytest.mark.parametrize( 'stager_setup,options,rule_cfg,spec_file,expected', [stager_setup_params('foo-package', 'test-b', spec_rule_config) + @@ -349,7 +342,6 @@ def test_rule_spec(stager_setup, expected): assert stager.log_cmd.mock_calls[0] == call(expected_cmd, cwd=stager.checkout) -@xfail(strict=True) @pytest.mark.parametrize( 'stager_setup,options,rule_cfg,spec_file,expected', [stager_setup_params('foo-package', 'test-b', re_rule_config) + @@ -375,7 +367,6 @@ def test_rule_re(stager_setup, expected): print(spec_words) assert spec_words.count(word) == count -@xfail(strict=True) @pytest.mark.parametrize('stager_setup,options,rule_cfg,spec_file,expected', [stager_setup_params('foo-package', 'test-b', patch_rule_config_add) + (contains_string('Patch2: foo.patch'),), @@ -401,7 +392,6 @@ def test_rule_patch(stager_setup, expected): assert_that(spec, expected) -@xfail(strict=True) @pytest.mark.parametrize( 'stager_setup,options,rule_cfg,spec_file,expected', [stager_setup_params('foo-package', 'test-b', source_rule_config_add) + @@ -428,7 +418,6 @@ def test_rule_source(stager_setup, expected): assert_that(spec, expected) -@xfail(strict=True) @pytest.mark.parametrize('stager_setup,options,rule_cfg,spec_file,expected', [stager_setup_params('foo-package', 'test-b', script_rule_config) + (("{rules_dir}/some-script {checkout_dir} {spec_file}",),), @@ -449,7 +438,6 @@ def test_rule_script(stager_setup, expected): expected_cmd.append(e) assert stager.log_cmd.mock_calls[0] == call(expected_cmd, cwd=stager.checkout) -@xfail(strict=True) @pytest.mark.parametrize('stager_setup,options,rule_cfg,spec_file,expected', [stager_setup_mmd_params('postgresql', 'test-b', mmd_rule_config) + (contains_string('ref: stream-centos-9.6'),), @@ -473,7 +461,6 @@ def test_rule_mmd(stager_setup, expected): assert_that(mmd, expected) -@xfail(strict=True) @pytest.mark.parametrize('stager_setup,options,rule_cfg,spec_file', [stager_setup_mmd_params('postgresql', 'test-b', mmd_rule_config2)], ids=['mmd-replace-no-change'], diff --git a/tests/test_rpms.py b/tests/test_rpms.py index 2bda7f6..960a28a 100644 --- a/tests/test_rpms.py +++ b/tests/test_rpms.py @@ -9,19 +9,16 @@ from subprocess import PIPE, Popen, check_call, check_output import pytest import yaml +import six from configparser import RawConfigParser from hamcrest import assert_that, calling, empty, equal_to, not_, raises from mock import MagicMock, call, patch from .matchers import exits -# ensure python2 before attempting to import sources -if sys.version_info < (3, 0): - from alt_src.alt_src import (main, BaseProcessor, acquire_lock, StartupError, - SanityError, InputError, CONFIG_DEFAULTS, Stager, Pusher, - CommandError) - -xfail = pytest.mark.xfail(sys.version_info >= (3, 0), reason="Incompatible with python3") +from alt_src.alt_src import (main, BaseProcessor, acquire_lock, StartupError, + SanityError, InputError, CONFIG_DEFAULTS, Stager, Pusher, + CommandError) TESTS_PATH = os.path.dirname(__file__) RPMS_PATH = os.path.join(TESTS_PATH, 'data', 'rpms') @@ -137,6 +134,8 @@ def git_subject(git_dir, ref): cmd = ['git', 'show', '-s', '--format=%s', ref] proc = Popen(cmd, cwd=git_dir, stdout=PIPE) out, _ = proc.communicate() + if not isinstance(out, str) and isinstance(out, bytes): + out = out.decode('utf-8') assert_that(proc.returncode, equal_to(0), "`git show' failed") @@ -177,7 +176,6 @@ def get_test_mmd_str_and_dict(): return mmd_str, mmd_dict['data'] -@xfail(strict=True) @pytest.mark.parametrize('branch,name,version,release', [ ('c7', 'grub2', '2.02', '0.64.el7'), ('c7', 'ntp', '4.2.6p5', '25.el7_3.2'), @@ -217,7 +215,6 @@ def test_push_with_debrand(config_file, pushdir, lookasidedir, remove_handlers() -@xfail(strict=True) @pytest.mark.parametrize('branch,name,version,release', [ ('c7', 'grub2', '2.02', '0.64.el7'), ('c7', 'ntp', '4.2.6p5', '25.el7_3.2'), @@ -270,7 +267,6 @@ def test_repush_with_staged_data(config_file, pushdir, lookasidedir, assert_that(files, not_(empty())) -@xfail(strict=True) @pytest.mark.parametrize('branch,name,version,release', [ ('c7', 'grub2', '2.02', '0.64.el7'), ('c7', 'ntp', '4.2.6p5', '25.el7_3.2'), @@ -333,7 +329,6 @@ def test_repush_without_staged_data(config_file, pushdir, lookasidedir, assert_that(files, not_(empty())) -@xfail(strict=True) @pytest.mark.parametrize('branch,name,version,release', [ ('c7', 'fake', '1.1', '22'), # need no-debrand packages for this test @@ -380,7 +375,6 @@ def test_repush_without_tag(config_file, pushdir, lookasidedir, branch, assert dupwarn -@xfail(strict=True) @pytest.mark.parametrize('branch,name,version,release', [ ('c7', 'grub2', '2.02', '0.64.el7'), ]) @@ -440,7 +434,6 @@ def test_push_with_existing_local_tag(config_file, pushdir, lookasidedir, remove_handlers() -@xfail(strict=True) def test_repush_with_state_init(config_file, pushdir, lookasidedir, default_config, capsys): rpm = 'grub2-2.02-0.64.el7.src.rpm' @@ -478,7 +471,6 @@ def test_repush_with_state_init(config_file, pushdir, lookasidedir, default_conf assert_that(files, not_(empty())) -@xfail(strict=True) def test_repush_with_state_none(config_file, lookasidedir, capsys): """ set_state fails, state file is not created, so get_state fails to open @@ -522,19 +514,17 @@ def test_repush_with_state_none(config_file, lookasidedir, capsys): assert_that(files, not_(empty())) -@xfail(strict=True) def test_get_state_with_error_other_than_enoent(tempdir): options = MagicMock(koji=None, source=tempfile.mkstemp(dir=tempdir)[1]) processor = BaseProcessor(options) processor.workdir = tempfile.mkstemp(dir=tempdir)[1] # attempting to open state file raises generic IOError - with patch('__builtin__.open', autospec=True, side_effect=IOError): + with patch('six.moves.builtins.open', autospec=True, side_effect=IOError): # error is raised by method because only ENOENT is handled assert_that(calling(processor.get_state), raises(IOError)) -@xfail(strict=True) def test_repush_with_state_staged(config_file, pushdir, lookasidedir, default_config, capsys): rpm = 'grub2-2.02-0.64.el7.src.rpm' @@ -577,7 +567,6 @@ def test_repush_with_state_staged(config_file, pushdir, lookasidedir, default_co assert_that(files, not_(empty())) -@xfail(strict=True) def test_log_cmd_with_retries(capsys): mock_options = MagicMock(koji=False) @@ -602,7 +591,6 @@ def test_log_cmd_with_retries(capsys): assert expected in err -@xfail(strict=True) @pytest.mark.parametrize('cmd, expected', [(['git', 'clone', 'some_git_url'], 4), (['rsync', 'src', 'dst'], 4), (['echo', 'foo'], 1) @@ -619,7 +607,6 @@ def test_default_tries(cmd, expected): assert processor.default_tries(cmd) == expected -@xfail(strict=True) def test_push_when_already_pushed(config_file, lookasidedir, default_config, capsys): """ test if the same content has already pushed to remote, @@ -658,6 +645,8 @@ def test_push_when_already_pushed(config_file, lookasidedir, default_config, cap git_url = default_config['git_push_url'] % {'package':'rcm-repoquery'} cmd = ['git', 'tag'] out = check_output(cmd, cwd=git_url) + if not isinstance(out, str) and isinstance(out, bytes): + out = out.decode('utf-8') assert sorted(out.splitlines()) == ['imports/c7/rcm-repoquery-1.4-1.bar', 'imports/c7/rcm-repoquery-1.4-1.foo'] @@ -667,7 +656,6 @@ def test_push_when_already_pushed(config_file, lookasidedir, default_config, cap assert_that(files, not_(empty())) -@xfail(strict=True) def test_acquire_release_lock(tempdir): # test lock and relase file lock function works as expected logger = logging.getLogger('altsrc') @@ -708,7 +696,6 @@ def test_acquire_release_lock(tempdir): remove_handlers() -@xfail(strict=True) def test_stage_only(config_file, pushdir, capsys): """ test a task without push option @@ -730,7 +717,6 @@ def test_stage_only(config_file, pushdir, capsys): remove_handlers() -@xfail(strict=True) def test_stage_repo_no_master(config_file, pushdir, capsys, default_config): """ check staging on new branch in repo having no master branch @@ -786,7 +772,6 @@ def log_cmd(cmd, fatal=True, **kwargs): remove_handlers() -@xfail(strict=True) def test_not_existing_source_file(config_file): rpm = 'foo.src.rpm' @@ -800,7 +785,6 @@ def test_not_existing_source_file(config_file): remove_handlers() -@xfail(strict=True) def test_srpm_koji(mock_koji_session, mock_koji_pathinfo): mock_koji_session.return_value.getRPM.return_value = {'arch': 'src', 'build_id': 42} mock_koji_pathinfo.return_value.build.return_value = "test_build" @@ -812,7 +796,6 @@ def test_srpm_koji(mock_koji_session, mock_koji_pathinfo): assert_that(processor.source_file, equal_to("test_build/test_relpath")) -@xfail(strict=True) @pytest.mark.parametrize('getRPM_return_value', [{'arch': 'foo'}, None], ids=("wrong_arch", "source_not_found")) @@ -825,7 +808,6 @@ def test_srpm_koji_sanity_error(getRPM_return_value, mock_koji_session, mock_koj assert_that(calling(BaseProcessor).with_args(mock_options), raises(SanityError)) -@xfail(strict=True) def test_module_src_koji(mock_koji_session, mock_koji_pathinfo): binfo = {'extra': {'typeinfo': {'module': {'modulemd_str': "foo_module_str"}}}} mock_koji_session.return_value.getBuild.return_value = binfo @@ -838,7 +820,6 @@ def test_module_src_koji(mock_koji_session, mock_koji_pathinfo): assert_that(processor.mmd, equal_to("foo_module_str")) -@xfail(strict=True) def test_module_src_koji_build_not_found(mock_koji_session, mock_koji_pathinfo): mock_koji_session.return_value.getBuild.return_value = None mock_koji_pathinfo.return_value.build.return_value = "test_build" @@ -847,7 +828,6 @@ def test_module_src_koji_build_not_found(mock_koji_session, mock_koji_pathinfo): assert_that(calling(BaseProcessor).with_args(mock_options), raises(SanityError)) -@xfail(strict=True) def test_read_srpm_input_error(mock_koji_session, mock_koji_pathinfo): mock_koji_session.return_value.getRPM.return_value = {'arch': 'src', 'build_id': 42} mock_koji_pathinfo.return_value.build.return_value = "test_build" @@ -860,7 +840,6 @@ def test_read_srpm_input_error(mock_koji_session, mock_koji_pathinfo): assert_that(calling(processor.read_srpm), raises(InputError)) -@xfail(strict=True) def test_read_mmd_str(mock_koji_session, mock_koji_pathinfo): mmd_str, mmd_dict = get_test_mmd_str_and_dict() @@ -878,7 +857,6 @@ def test_read_mmd_str(mock_koji_session, mock_koji_pathinfo): assert_that(processor.summary, equal_to(mmd_dict['summary'])) -@xfail(strict=True) def test_mmd_no_changelog(mock_koji_session, mock_koji_pathinfo): mmd_str, mmd_dict = get_test_mmd_str_and_dict() mock_koji_pathinfo.return_value.rpm.return_value = "test_relpath" @@ -897,7 +875,6 @@ def test_mmd_no_changelog(mock_koji_session, mock_koji_pathinfo): assert_that(processor.package, equal_to(mmd_dict['name'])) -@xfail(strict=True) def test_git_url_module(mock_koji_session, mock_koji_pathinfo): mmd_str, mmd_dict = get_test_mmd_str_and_dict() binfo = {'extra': {'typeinfo': {'module': {'modulemd_str': mmd_str}}}} @@ -920,13 +897,11 @@ def test_git_url_module(mock_koji_session, mock_koji_pathinfo): % {'package': mmd_dict['name']})) -@xfail(strict=True) def test_unsupported_source_startup_error(): mock_options = MagicMock(koji=True, source="build_nvr.src.foo") assert_that(calling(BaseProcessor).with_args(mock_options), raises(StartupError)) -@xfail(strict=True) def test_stage_module_src(config_file, pushdir, lookasidedir, capsys, default_config, mock_koji_session, mock_koji_pathinfo): """Verify that alt-src command completes without any errors and generates @@ -964,7 +939,6 @@ def test_stage_module_src(config_file, pushdir, lookasidedir, capsys, default_co remove_handlers() -@xfail(strict=True) def test_push_to_pagure(config_file, key_file, pushdir, lookasidedir, capsys): rpm = 'grub2-2.02-0.64.el7.src.rpm' @@ -1003,7 +977,6 @@ def side_eff(): remove_handlers() -@xfail(strict=True) def test_push_module_to_pagure(config_file, key_file, pushdir, capsys, mock_koji_session, mock_koji_pathinfo): """ verifies modules are pushed to pagure repo without any error """ @@ -1044,7 +1017,6 @@ def side_eff(): assert_that(len(err), equal_to(0)) -@xfail(strict=True) @pytest.mark.parametrize('cmd_args,package,expected_extra_dir', [ ([os.path.join(RPMS_PATH, 'grub2-2.02-0.64.el7.src.rpm')], 'grub2', 'rpms'), (['--koji', 'fake-nvr:modulemd.src.txt'], 'my_package', 'modules'), @@ -1108,7 +1080,6 @@ def side_eff(): assert missing_repo_str in std assert "Initializing new repo:" in std -@xfail(strict=True) @pytest.mark.parametrize('cmd_args,package,expected_extra_dir', [ ([os.path.join(RPMS_PATH, 'grub2-2.02-0.64.el7.src.rpm')], 'grub2', 'rpms'), (['--koji', 'fake-nvr:modulemd.src.txt'], 'my_package', 'modules'), @@ -1173,7 +1144,6 @@ def patched_get_output_sf(cmd, *args, **kwargs): assert "Initializing new repo:" not in std -@xfail(strict=True) def test_option_alias(config_file, pushdir, lookasidedir, default_config, capsys): rpm = 'grub2-2.02-0.64.el7'