Skip to content

Commit bd9a069

Browse files
committed
TST: enable --fatal-meson-warnings for all tests
1 parent 7efa417 commit bd9a069

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/conftest.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,18 @@ def cleanenv():
192192
# $MACOSX_DEPLOYMENT_TARGET affects the computation of the platform tag on macOS.
193193
yield mpatch.delenv('MACOSX_DEPLOYMENT_TARGET', raising=False)
194194
mpatch.undo()
195+
196+
197+
@pytest.fixture(autouse=True, scope='session')
198+
def meson_fatal_warnings():
199+
# Cannot use the 'monkeypatch' fixture because of scope mismatch.
200+
mpatch = pytest.MonkeyPatch()
201+
mesonpy_project_init = mesonpy.Project.__init__
202+
203+
def __init__(self, source_dir, build_dir, meson_args=None, editable_verbose=False):
204+
if meson_args is None:
205+
meson_args = {}
206+
meson_args['setup'] = meson_args.get('setup', []) + ['--fatal-meson-warnings']
207+
mesonpy_project_init(self, source_dir, build_dir, meson_args, editable_verbose)
208+
209+
mpatch.setattr(mesonpy.Project, '__init__', __init__)

0 commit comments

Comments
 (0)