Page MenuHomePhabricator

some TestScriptSimulate tests are failing due to missing dependency package
Closed, ResolvedPublic

Description

for example:

_________________________ TestScriptSimulate.test_isbn _________________________

self = <tests.script_tests.TestScriptSimulate testMethod=test_isbn>

    def testScript(self):
        global_args = 'Global arguments available for all'
    
        cmd = [script_name]
    
        if args:
            cmd += args
    
        data_in = script_input.get(script_name)
    
        if is_autorun:
            timeout = 5
        else:
            timeout = None
    
        if self._results and script_name in self._results:
            error = self._results[script_name]
            if isinstance(error, StringTypes):
                stdout = None
            else:
                stdout, error = error
        else:
            stdout = None
            error = None
    
        test_overrides = {}
        if not hasattr(self, 'net') or not self.net:
            test_overrides['pywikibot.Site'] = 'None'
    
        result = execute_pwb(cmd, data_in, timeout=timeout,
                             error=error, overrides=test_overrides)
    
        stderr = result['stderr'].splitlines()
        stderr_sleep = [l for l in stderr
                        if l.startswith('Sleeping for ')]
        stderr_other = [l for l in stderr
                        if not l.startswith('Sleeping for ')]
        if stderr_sleep:
            unittest_print('\n'.join(stderr_sleep))
    
        if result['exit_code'] == -9:
            unittest_print(' killed', end='  ')
    
        if error:
            self.assertIn(error, result['stderr'])
    
            exit_codes = [0, 1, 2, -9]
        elif not is_autorun:
            if stderr_other == []:
                stderr_other = None
            if stderr_other is not None:
                self.assertIn('Use -help for further information.',
                              stderr_other)
                self.assertNotIn('-help', args)
            else:
>               self.assertIn(global_args, result['stdout'])
E               AssertionError: u'Global arguments available for all' not found in u'The \'python-stdnum>=1.13\' distribution was not found and is required by the application\n\nPlease install/update required module with:\n\n\n    pip install "python-stdnum>=1.13"\n\n'

https://travis-ci.org/github/wikimedia/pywikibot/jobs/665654696

This is strange because these scripts are collected in failed_dep_script_set

collecting ... states_redirect depends on pycountry, which isn't available
patrol depends on mwparserfromhell, which isn't available
flickrripper depends on flickrapi, which isn't available
weblinkchecker depends on memento_client, which isn't available
match_images depends on PIL.Image, which isn't available
imageharvest depends on bs4, which isn't available
isbn depends on stdnum, which isn't available

Event Timeline

It happens only in pytest, unittest is fine

Change 582830 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [bufix] Skip TestScriptSimulate test with open dependencies

https://gerrit.wikimedia.org/r/582830

Change 582830 merged by jenkins-bot:
[pywikibot/core@master] [bufix] Skip TestScriptSimulate test with open dependencies

https://gerrit.wikimedia.org/r/582830

Xqt claimed this task.
This comment was removed by Xqt.