Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalizing testenv #2412

Closed
brandon-leapyear opened this issue May 5, 2022 · 3 comments
Closed

Generalizing testenv #2412

brandon-leapyear opened this issue May 5, 2022 · 3 comments
Labels
feature:new something does not exist yet, but should

Comments

@brandon-leapyear
Copy link

brandon-leapyear commented May 5, 2022

It seems to me that [testenv] does at least two things:

  1. Specify the base environment that all other testenvs inherit from
  2. Provide the fallback case for any env not matched by any other [testenv:...] definition

It seems like these two features should be explicit:

  1. Add a parent option for a testenv to specify another testenv to inherit from
  2. Allow patterns in a testenv name; e.g. [testenv:*-dist]
    • Related: Allow parametrization of any testenv #189
    • Use cases:
      • Set usedevelop by default, but adding -dist to the end of any environment uses a wheel build
      • If someone had two test frameworks (e.g. a pytest suite and a unittest suite), you could have both [testenv:pytest-*] and [testenv:unittest-*]
        • I guess the current approach for this is to have two different tox.ini files
        • Generative sections don't completely help here, as I'd like to keep the current [testenv] functionality of being to specify both py37-django15 and py37-pandas13; a generative section like py{37,38,39,310}-django{15,16}-pandas{11,12,13} will require both django + pandas to be specified. Adding a trailing comma like py{37,38}-django{15,16,}-pandas{11,12,13,} doesn't work; it will require matching py37--pandas11.

With these two features, a tox 3 config

[testenv]
...

[testenv:docs]
...

would be equivalent to

[testenv:*]
...

[testenv:docs]
parent = [testenv:*]
...
@brandon-leapyear brandon-leapyear added the feature:new something does not exist yet, but should label May 5, 2022
@gaborbernat
Copy link
Member

tox 4 uses the key base instead of parent, but the feature is there, check the documentation 👌

@brandon-leapyear
Copy link
Author

brandon-leapyear commented Oct 11, 2022 via email

@gaborbernat
Copy link
Member

@gaborbernat what about the second feature mentioned?

no plans, we will add python config support that will allow this advanced use case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:new something does not exist yet, but should
Projects
None yet
Development

No branches or pull requests

2 participants