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

Fix regression with multiple env substitutions for the same key #2873

Merged
merged 3 commits into from
Jan 16, 2023

Commits on Jan 16, 2023

  1. test_replace_env_var_multiple: missing test case for chain detection

    When the same variables appear across separate substitutions, it should not
    trigger chain detection.
    masenf committed Jan 16, 2023
    Configuration menu
    Copy the full SHA
    db9fe18 View commit details
    Browse the repository at this point in the history
  2. test_replace_env_var_circular_flip_flop: assert on circular log message

    Ensure that a true circular chain of env vars logs the correct error message.
    masenf committed Jan 16, 2023
    Configuration menu
    Copy the full SHA
    52fed10 View commit details
    Browse the repository at this point in the history
  3. replace: copy ConfigArgs for each new replacement

    Before the replacement parser rewrite, args was being copied in the `replace`
    function:
    
    https://github.com/tox-dev/tox/blob/955a7fb8864a9e682ec91589e0c10115ab6fa6a5/src/tox/config/loader/ini/replace.py#L35
    
    This restores the previous behavior by copying `conf_args` at the beginning of
    `_replace_match`.
    
    This change also preseves chain detection logic by passing the copied
    `conf_args` back into `replace` when recursively expanding a previous
    replacement so that any values saved in the chain during the previous replace
    are present for the recursive replace (test case added in previous commit).
    
    Fix tox-dev#2869
    masenf committed Jan 16, 2023
    Configuration menu
    Copy the full SHA
    82d1bf4 View commit details
    Browse the repository at this point in the history