dev-python/pytest-benchmark: add python3_10 target in new revision

Package-Manager: Portage-3.0.29, Repoman-3.0.3
Signed-off-by: Alfred Wingate <parona@protonmail.com>
This commit is contained in:
Alfred Wingate 2021-12-12 00:20:21 +02:00
parent cef3ad5e68
commit a56d72d8b2
No known key found for this signature in database
GPG Key ID: A12750536B5E7010
3 changed files with 135 additions and 3 deletions

View File

@ -0,0 +1,87 @@
diff --git a/tests/test_cli.py b/tests/test_cli.py
index c71ef22..d2ae1da 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -3,13 +3,14 @@ from collections import namedtuple
import py
import pytest
+from os import environ
from _pytest.pytester import LineMatcher
pytest_plugins = 'pytester',
THIS = py.path.local(__file__)
STORAGE = THIS.dirpath('test_storage')
-
+environ["LINES"]="40"
@pytest.fixture
def testdir(testdir, monkeypatch):
@@ -20,13 +21,13 @@ def testdir(testdir, monkeypatch):
def test_help(testdir):
result = testdir.run('py.test-benchmark', '--help')
- result.stdout.fnmatch_lines([
+ result.stdout.re_match_lines([
"usage: py.test-benchmark *",
" {help,list,compare} ...",
"",
"pytest_benchmark's management commands.",
"",
- "optional arguments:",
+ "option(s|al arguments):",
" -h [COMMAND], --help [COMMAND]",
" Display help and exit.",
" --storage URI, -s URI",
@@ -49,7 +50,7 @@ def test_help(testdir):
def test_help_command(testdir):
result = testdir.run('py.test-benchmark', 'help')
- result.stdout.fnmatch_lines([
+ result.stdout.re_match_lines([
'usage: py.test-benchmark help [-h] [command]',
'',
'Display help and exit.',
@@ -57,7 +58,7 @@ def test_help_command(testdir):
'positional arguments:',
' command',
'',
- 'optional arguments:',
+ 'option(s|al arguments):',
' -h, --help show this help message and exit',
])
@@ -65,12 +66,12 @@ def test_help_command(testdir):
@pytest.mark.parametrize('args', ['list --help', 'help list'])
def test_help_list(testdir, args):
result = testdir.run('py.test-benchmark', *args.split())
- result.stdout.fnmatch_lines([
+ result.stdout.re_match_lines([
"usage: py.test-benchmark list [-h]",
"",
"List saved runs.",
"",
- "optional arguments:",
+ "option(s|al arguments):",
" -h, --help show this help message and exit",
])
assert result.ret == 0
@@ -79,7 +80,7 @@ def test_help_list(testdir, args):
@pytest.mark.parametrize('args', ['compare --help', 'help compare'])
def test_help_compare(testdir, args):
result = testdir.run('py.test-benchmark', *args.split())
- result.stdout.fnmatch_lines([
+ result.stdout.re_match_lines([
"usage: py.test-benchmark compare [-h] [--sort COL] [--group-by LABEL]",
" [--columns LABELS] [--name FORMAT]",
" [--histogram [FILENAME-PREFIX]]",
@@ -92,7 +93,7 @@ def test_help_compare(testdir, args):
" glob_or_file Glob or exact path for json files. If not specified",
" all runs are loaded.",
"",
- "optional arguments:",
+ "option(s|al arguments):",
" -h, --help show this help message and exit",
" --sort COL Column to sort on. Can be one of: 'min', 'max',",
" 'mean', 'stddev', 'name', 'fullname'. Default: 'min'",

View File

@ -0,0 +1,45 @@
# Copyright 2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{8..10} )
inherit distutils-r1 multiprocessing
DESCRIPTION="py.test fixture for benchmarking code"
HOMEPAGE="https://github.com/ionelmc/pytest-benchmark"
SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"
LICENSE="BSD-2"
SLOT="0"
KEYWORDS="~amd64"
IUSE="doc test"
RESTRICT="!test? ( test )"
RDEPEND="
dev-python/aspectlib[${PYTHON_USEDEP}]
dev-python/elasticsearch-py[${PYTHON_USEDEP}]
dev-python/py-cpuinfo[${PYTHON_USEDEP}]
dev-python/pygal[${PYTHON_USEDEP}]
dev-python/pygaljs[${PYTHON_USEDEP}]
dev-python/pytest[${PYTHON_USEDEP}]
"
DEPEND="
test? (
${RDEPEND}
dev-python/freezegun[${PYTHON_USEDEP}]
dev-python/pytest-xdist[${PYTHON_USEDEP}]
)
"
distutils_enable_tests --install pytest
distutils_enable_sphinx docs dev-python/sphinx-py3doc-enhanced-theme
PATCHES=( "${FILESDIR}/python3_10_test.patch" )
# Test success is affected by terminal width
EPYTEST_DESELECT=( tests/test_cli.py::test_help tests/test_cli.py::test_help_compare )
python_test() {
epytest -n "$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")"
}

View File

@ -27,9 +27,9 @@ RDEPEND="
DEPEND="
dev-python/sphinx-py3doc-enhanced-theme[${PYTHON_USEDEP}]
test? (
${RDEPEND}
dev-python/freezegun[${PYTHON_USEDEP}]
dev-python/pytest-xdist[${PYTHON_USEDEP}]
${RDEPEND}
dev-python/freezegun[${PYTHON_USEDEP}]
dev-python/pytest-xdist[${PYTHON_USEDEP}]
)
"
BDEPEND="