From 30182e15deaf9db270e7fc44b4e77367e3be6fae Mon Sep 17 00:00:00 2001 From: Trinh Anh Ngoc Date: Sun, 18 Dec 2022 10:47:20 +0700 Subject: [PATCH] Update stubs --- odoo-stubs/tests/common.pyi | 14 ++++++++++++-- odoo-stubs/tools/js_transpiler.pyi | 5 +++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/odoo-stubs/tests/common.pyi b/odoo-stubs/tests/common.pyi index d294a19..d9c57cb 100644 --- a/odoo-stubs/tests/common.pyi +++ b/odoo-stubs/tests/common.pyi @@ -4,12 +4,13 @@ import sys import unittest from concurrent.futures import Future from re import Pattern +from types import TracebackType from itertools import count from subprocess import Popen from threading import Thread from typing import Any, Callable, Generator, Generic, Iterator, Mapping, Match, TypeVar -from unittest import TestSuite +from unittest import TestCase, TestSuite from xmlrpc import client as xmlrpclib import requests @@ -73,6 +74,7 @@ class MetaCase(type): def _normalize_arch_for_assert(arch_string: str, parser_method: str = ...) -> str: ... class BaseCase(unittest.TestCase, metaclass=MetaCase): + _python_version: tuple _class_cleanups: list tearDown_exceptions: list registry: Registry @@ -115,7 +117,15 @@ class BaseCase(unittest.TestCase, metaclass=MetaCase): def assertXMLEqual(self, original: str, expected: str) -> None: ... def assertHTMLEqual(self, original: str, expected: str) -> None: ... profile_session: str - def profile(self, **kwargs) -> Profiler: ... + def profile(self, description: str = ..., **kwargs) -> Profiler: ... + def _callSetUp(self) -> None: ... + +class _ErrorCatcher(list): + __slots__ = ['test'] + test: TestCase + def __init__(self, test: TestCase) -> None: ... + def append(self, error) -> None: ... + def _complete_traceback(self, initial_tb: TracebackType) -> TracebackType: ... savepoint_seq: count[int] diff --git a/odoo-stubs/tools/js_transpiler.pyi b/odoo-stubs/tools/js_transpiler.pyi index f33a82c..7624c8f 100644 --- a/odoo-stubs/tools/js_transpiler.pyi +++ b/odoo-stubs/tools/js_transpiler.pyi @@ -1,3 +1,4 @@ +from typing import Iterable, MutableSet from re import Pattern def transpile_javascript(url: str, content: str) -> str: ... @@ -6,7 +7,7 @@ URL_RE: Pattern def url_to_module_path(url: str) -> str: ... def wrap_with_qunit_module(url: str, content: str) -> str: ... -def wrap_with_odoo_define(module_path: str, content: str) -> str: ... +def wrap_with_odoo_define(module_path: str, dependencies: Iterable[str], content: str) -> str: ... EXPORT_FCT_RE: Pattern @@ -67,7 +68,7 @@ def convert_default_and_named_import(content: str) -> str: ... RELATIVE_REQUIRE_RE: Pattern -def convert_relative_require(url: str, content: str) -> str: ... +def convert_relative_require(url: str, dependencies: MutableSet[str], content: str) -> str: ... IMPORT_STAR: Pattern