Skip to content

Commit

Permalink
add own ci job for legacy setuptools testing an skip it for normal tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RonnyPfannschmidt committed Sep 2, 2021
1 parent 86d11ca commit a17b8d1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@ jobs:
if: matrix.os == 'ubuntu-latest'
- run: pytest

test_legacy_setuptools:
runs-on: ubuntu-lates
steps:
- uses: actions/checkout@v1
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: "3.6"
architecture: x64
- run: pip install -e .[toml] pytest virtualenv
- run: pytest --test-legacy testing/test_setuptools_support.py
check_selfinstall:
runs-on: ubuntu-latest
strategy:
Expand Down
7 changes: 7 additions & 0 deletions testing/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ def pytest_report_header():
return res


def pytest_addoption(parser):
group = parser.getgroup("setuptools_scm")
group.addoption(
"--test-legacy", dest="scm_test_virtualenv", default=False, action="store_true"
)


class Wd:
commit_command = None
add_command = None
Expand Down
4 changes: 4 additions & 0 deletions testing/test_setuptools_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ def get_venv(self, python, pip, setuptools, prefix="scm"):

@pytest.fixture
def venv_maker(pytestconfig):
if not pytestconfig.getoption("--test-legacy"):
pytest.skip(
"testing on legacy setuptools disabled, pass --test-legacy to run them"
)
dir = pytestconfig.cache.makedir("setuptools_scm_venvs")
path = pathlib.Path(str(dir))
return VenvMaker(path)
Expand Down

0 comments on commit a17b8d1

Please sign in to comment.