Skip to content

Commit

Permalink
Add fixture to capture if the value changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Sep 4, 2024
1 parent 41cf015 commit d94cf27
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
- name: Install tox
run: python -m pip install tox
- name: Run
run: tox -- -k build_base
run: tox
- name: Create coverage report
if: hashFiles('.coverage') != '' # Rudimentary `file.exists()`
run: pipx run coverage xml --ignore-errors
Expand Down
10 changes: 10 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,13 @@ def conditional_skip(request):
def windows_only():
if platform.system() != 'Windows':
pytest.skip("Windows only")


@pytest.fixture(autouse=True)
def check_setuptools_use_distutils():
import os
orig = os.environ.get('SETUPTOOLS_USE_DISTUTILS')
yield
current = os.environ.get('SETUPTOOLS_USE_DISTUTILS')
if current != orig:
raise RuntimeError(f"SETUPTOOLS_USE_DISTUTILS changed from {orig} to {current}.")

0 comments on commit d94cf27

Please sign in to comment.