Skip to content

Commit 2253eec

Browse files
Add tox option testenv-skip-test-extra.
Set this to true if your package does not have a ``test`` extra. Otherwise tests fail with latest `tox`. See plone/meta#325
1 parent 5a7f2bc commit 2253eec

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

CHANGES.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ Change log
44
2.2 (unreleased)
55
----------------
66

7+
- Add tox option ``testenv-skip-test-extra``.
8+
Set this to true if your package does not have a ``test`` extra.
9+
Otherwise tests fail with latest `tox`.
10+
711
- Remove special treatment for macOS test runners on GitHub
812

913
- Print out a warning if a ``setuptools`` install time dependency is found

docs/narr.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,10 @@ testenv-additional-extras
458458
Additional entries for the ``extras`` option in ``[testenv]`` of
459459
``tox.ini``. This option has to be a list of strings without indentation.
460460

461+
testenv-skip-test-extra
462+
Don't add the standard ``test`` in the ``extras`` option in ``[testenv]``
463+
of ``tox.ini``. This option has to be true/false. Default is false.
464+
461465
testenv-commands-pre
462466
Replacement for the default ``commands_pre`` option in ``[testenv]`` of
463467
``tox.ini``. This option has to be a list of strings without indentation.

src/zope/meta/config_package.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,8 @@ def tox(self):
462462
testenv_additional = self.tox_option('testenv-additional')
463463
testenv_additional_extras = self.tox_option(
464464
'testenv-additional-extras')
465+
testenv_skip_test_extra = self.tox_option(
466+
'testenv-skip-test-extra', False)
465467
testenv_commands_pre = self.tox_option('testenv-commands-pre')
466468
testenv_commands = self.tox_option('testenv-commands')
467469
testenv_setenv = self.tox_option('testenv-setenv')
@@ -503,6 +505,7 @@ def tox(self):
503505
lint_diff_on_failure=lint_diff_on_failure,
504506
testenv_additional=testenv_additional,
505507
testenv_additional_extras=testenv_additional_extras,
508+
testenv_skip_test_extra=testenv_skip_test_extra,
506509
testenv_commands=testenv_commands,
507510
testenv_commands_pre=testenv_commands_pre,
508511
testenv_deps=testenv_deps,

src/zope/meta/default/tox-testenv.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ commands =
4242
sphinx-build -b doctest -d {envdir}/.cache/doctrees docs {envdir}/.cache/doctest
4343
{% endif %}
4444
extras =
45+
{% if not testenv_skip_test_extra %}
4546
test
47+
{% endif %}
4648
{% if with_sphinx_doctests %}
4749
docs
4850
{% endif %}

0 commit comments

Comments
 (0)