summaryrefslogtreecommitdiff
path: root/eclass/python-utils-r1.eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2023-11-18 16:55:11 +0100
committerMichał Górny <mgorny@gentoo.org>2023-11-19 17:01:14 +0100
commit171a72e48ca08dd7d5f1a0f9c00d5a3297db1239 (patch)
treec90204274e17b6ccfbeb4f841702852a19fbbf0b /eclass/python-utils-r1.eclass
parenta50f2ca09542794bf87e9f3a518d88fecdc0a2fe (diff)
downloadgentoo-171a72e48ca08dd7d5f1a0f9c00d5a3297db1239.tar.gz
gentoo-171a72e48ca08dd7d5f1a0f9c00d5a3297db1239.tar.bz2
gentoo-171a72e48ca08dd7d5f1a0f9c00d5a3297db1239.zip
python-utils-r1.eclass: Do not pass `-p no:*` w/ no autoloading
Modify `epytest` not to pass our plethora of `-p no:*` arguments when `PYTEST_DISABLE_PLUGIN_AUTOLOAD` is set. This is NFC since the plugins wouldn't be loaded anyway. Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass/python-utils-r1.eclass')
-rw-r--r--eclass/python-utils-r1.eclass51
1 files changed, 28 insertions, 23 deletions
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 1de4f325de33..394f64a5d139 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1362,31 +1362,36 @@ epytest() {
# count is more precise when we're dealing with a large number
# of tests
-o console_output_style=count
- # disable the undesirable-dependency plugins by default to
- # trigger missing argument strips. strip options that require
- # them from config files. enable them explicitly via "-p ..."
- # if you *really* need them.
- -p no:cov
- -p no:flake8
- -p no:flakes
- -p no:pylint
- # sterilize pytest-markdown as it runs code snippets from all
- # *.md files found without any warning
- -p no:markdown
- # pytest-sugar undoes everything that's good about pytest output
- # and makes it hard to read logs
- -p no:sugar
- # pytest-xvfb automatically spawns Xvfb for every test suite,
- # effectively forcing it even when we'd prefer the tests
- # not to have DISPLAY at all, causing crashes sometimes
- # and causing us to miss missing virtualx usage
- -p no:xvfb
- # intrusive packages that break random test suites
- -p no:pytest-describe
- -p no:plus
- -p no:tavern
)
+ if [[ ! ${PYTEST_DISABLE_PLUGIN_AUTOLOAD} ]]; then
+ args+=(
+ # disable the undesirable-dependency plugins by default to
+ # trigger missing argument strips. strip options that require
+ # them from config files. enable them explicitly via "-p ..."
+ # if you *really* need them.
+ -p no:cov
+ -p no:flake8
+ -p no:flakes
+ -p no:pylint
+ # sterilize pytest-markdown as it runs code snippets from all
+ # *.md files found without any warning
+ -p no:markdown
+ # pytest-sugar undoes everything that's good about pytest output
+ # and makes it hard to read logs
+ -p no:sugar
+ # pytest-xvfb automatically spawns Xvfb for every test suite,
+ # effectively forcing it even when we'd prefer the tests
+ # not to have DISPLAY at all, causing crashes sometimes
+ # and causing us to miss missing virtualx usage
+ -p no:xvfb
+ # intrusive packages that break random test suites
+ -p no:pytest-describe
+ -p no:plus
+ -p no:tavern
+ )
+ fi
+
if [[ ${EPYTEST_XDIST} ]]; then
local jobs=${EPYTEST_JOBS:-$(makeopts_jobs)}
if [[ ${jobs} -gt 1 ]]; then