Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 715318 - dev-python/pytest-4.6.9 fails test test_pytest_entry_points_are_identical
Summary: dev-python/pytest-4.6.9 fails test test_pytest_entry_points_are_identical
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords: TESTFAILURE
Depends on:
Blocks:
 
Reported: 2020-03-29 14:37 UTC by Warren Thoben
Modified: 2020-05-16 06:40 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Warren Thoben 2020-03-29 14:37:13 UTC
If pytest is not yet installed on the system, then dev-python/pytest-4.6.9 fails the test test_pytest_entry_points_are_identical with "PackageNotFoundError: pytest". This is expected as it is not installed and thus cannot be found.

The solution is simple: use distutils_install_for_testing prior to running the test suite.
The python_test() function would look like:

python_test() {
        # The following line is new:
        distutils_install_for_testing

	# In v4.1.1, pytest started being picky about its own verbosity options.
	# running pytest on itself with -vv made 3 tests fail. This is why we don't
	# have it below.
	"${EPYTHON}" "${BUILD_DIR}"/lib/pytest.py --lsof -rfsxX \
		|| die "tests failed with ${EPYTHON}"
}

Not tested but it seems that other pytest versions are affected, too.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-05-13 08:33:46 UTC
Thanks for the report.  Indeed I can reproduce this on a fresh install.  I'm going to push the fix soonish.
Comment 2 Larry the Git Cow gentoo-dev 2020-05-13 09:03:05 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6025336afa774618665d597e273221ba89cd5c31

commit 6025336afa774618665d597e273221ba89cd5c31
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2020-05-13 08:30:53 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2020-05-13 09:02:59 +0000

    dev-python/pytest: Fix tests on initial install
    
    Closes: https://bugs.gentoo.org/715318
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 dev-python/pytest/pytest-4.6.10.ebuild | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Comment 3 Warren Thoben 2020-05-16 06:40:07 UTC
> Thanks for the report.

Thanks for fixing.