Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 700458

Summary: dev-python/coverage-4.5.4 fails test
Product: Gentoo Linux Reporter: Alexey <alexey+gentoo>
Component: Current packagesAssignee: Robin Johnson <robbat2>
Status: RESOLVED OBSOLETE    
Severity: normal CC: paolo.pedroni, python, sam
Priority: Normal Keywords: TESTFAILURE
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge --info
build.log

Description Alexey 2019-11-18 08:52:59 UTC
Created attachment 596618 [details]
emerge --info

args = (<tests.test_process.AliasedCommandTest testMethod=test_wrong_alias_doesnt_work>,), kwargs = {}

    @functools.wraps(method)
    def wrapper(*args, **kwargs):
        """Run the test method, and convert exceptions."""
        try:
>           result = method(*args, **kwargs)

tests/coveragetest.py:45:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_process.py:946: in test_wrong_alias_doesnt_work
    self.assertNotIn("Code coverage for Python", out)
E   AssertionError: 'Code coverage for Python' unexpectedly found in "Code coverage for Python.  Use 'coverage3 help' for help.\n"
Comment 1 Alexey 2019-11-18 08:57:06 UTC
Created attachment 596620 [details]
build.log
Comment 2 Brigid Dickel 2020-06-17 15:23:40 UTC
The test in question essentially checks whether coverage3 is in PATH when run under python2 (and coverage2 under python3):

    def test_wrong_alias_doesnt_work(self):
        # "coverage3" doesn't work on py2
        assert sys.version_info[0] in [2, 3]    # Let us know when Python 4 is out...
        badcmd = "coverage%d" % (5 - sys.version_info[0])
        out = self.run_command(badcmd)
        self.assertNotIn("Code coverage for Python", out)

If coverage is already installed on the system, then both coverage2 and coverage3 are in /usr/bin/, i.e. exists in PATH and thus the test fails.

Solutions I can think of:
1. Unset PATH to only contain the scripts/ directory of the (new) coverage installation. (probably a bad idea)
2. Skip the test (since many tests are already skipped, this seems to be the way to go).
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-03-02 00:30:56 UTC
Tests are now restricted.