Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 700458 - dev-python/coverage-4.5.4 fails test
Summary: dev-python/coverage-4.5.4 fails test
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords: TESTFAILURE
Depends on:
Blocks:
 
Reported: 2019-11-18 08:52 UTC by Alexey
Modified: 2021-03-02 00:30 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (file_700458.txt,19.48 KB, text/plain)
2019-11-18 08:52 UTC, Alexey
Details
build.log (build.log,61.43 KB, text/plain)
2019-11-18 08:57 UTC, Alexey
Details

Note You need to log in before you can comment on or make changes to this bug.
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.