Skip to content

Commit

Permalink
Preserve user-defined envlists tox.ini
Browse files Browse the repository at this point in the history
  • Loading branch information
domdfcoding committed Jan 27, 2022
1 parent 9622fe5 commit 9e155fc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions repo_helper/files/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,13 @@ def merge_existing(self, ini_file):
if "markers" in section:
existing_value = set(map(str.strip, section["markers"].value.splitlines()))
self._ini["pytest"]["markers"] = indent_join(sorted(filter(bool, existing_value)))
elif section.name == "envlists":
for key in section.options():
if key not in {"test", "qa", "cov"}:
existing_envlist = section[key].value.splitlines()
new_envlist = list(filter(bool, map(str.strip, existing_envlist)))
new_envlist_list = sorted(set(new_envlist), key=new_envlist.index)
self._ini["envlists"][key] = indent_join(new_envlist_list)

# TODO: for tox-isolation
# [testenv:{py36,py37,py38,pypy3,py39}]
Expand Down

0 comments on commit 9e155fc

Please sign in to comment.