diff --git a/odoo-stubs/tests/common.pyi b/odoo-stubs/tests/common.pyi index 0c98c5c..4add6ce 100644 --- a/odoo-stubs/tests/common.pyi +++ b/odoo-stubs/tests/common.pyi @@ -1,5 +1,6 @@ import collections from concurrent.futures import Future +from contextlib import contextmanager from itertools import count from subprocess import Popen from typing import Any, Callable, Generator, Mapping, Match, TypeVar @@ -84,12 +85,15 @@ class BaseCase(case.TestCase, metaclass=MetaCase): def startClassPatcher(cls, patcher): ... def with_user(self, login: str) -> None: ... def debug_mode(self) -> Generator[None, None, None]: ... + @contextmanager def assertRaises( self, exception, func: Any | None = ..., *args, **kwargs ) -> Generator[Any, None, None] | None: ... + @contextmanager def assertQueries( self, expected, flush: bool = ... ) -> Generator[list, None, None]: ... + @contextmanager def assertQueryCount( self, default: int = ..., flush: bool = ..., **counters ) -> Generator[None, None, None]: ...