diff options
| author | Xavier Claessens <xavier.claessens@collabora.com> | 2023-02-14 10:12:38 -0500 |
|---|---|---|
| committer | Xavier Claessens <xclaesse@gmail.com> | 2023-03-01 20:13:34 -0500 |
| commit | f0dc61a76403d3ad26cbfa8e3922fa84343ba7d4 (patch) | |
| tree | 7479c1af389b43a785c90a3a43e1574ff75d1205 /mesonbuild/interpreterbase/baseobjects.py | |
| parent | a952b01a0885da9cc89b637d78ee649aea437a95 (diff) | |
| download | meson-f0dc61a76403d3ad26cbfa8e3922fa84343ba7d4.tar.gz | |
interpreter: Add testcase..endtestcase clause support
This is currently only enabled when running unit tests to facilitate
writing failing unit tests.
Fixes: #11394
Diffstat (limited to 'mesonbuild/interpreterbase/baseobjects.py')
| -rw-r--r-- | mesonbuild/interpreterbase/baseobjects.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/mesonbuild/interpreterbase/baseobjects.py b/mesonbuild/interpreterbase/baseobjects.py index 820e0918c..d5b8c9476 100644 --- a/mesonbuild/interpreterbase/baseobjects.py +++ b/mesonbuild/interpreterbase/baseobjects.py @@ -22,6 +22,7 @@ import textwrap import typing as T from abc import ABCMeta +from contextlib import AbstractContextManager if T.TYPE_CHECKING: from typing_extensions import Protocol @@ -180,3 +181,7 @@ class IterableObject(metaclass=ABCMeta): def size(self) -> int: raise MesonBugException(f'size not implemented for {self.__class__.__name__}') + +class ContextManagerObject(MesonInterpreterObject, AbstractContextManager): + def __init__(self, subproject: 'SubProject') -> None: + super().__init__(subproject=subproject) |
