|
54 | 54 | ) |
55 | 55 | from tabulate import tabulate |
56 | 56 |
|
57 | | -# pylint: disable=wrong-import-position |
58 | 57 | from hdl_checker.tests import getTestTempPath, setupTestSuport, toCheckerDiagnostic |
59 | 58 |
|
60 | | -from hdl_checker import DEFAULT_LIBRARY |
| 59 | +import hdl_checker |
| 60 | +from hdl_checker import DEFAULT_LIBRARY, lsp |
61 | 61 | from hdl_checker.diagnostics import CheckerDiagnostic |
62 | 62 | from hdl_checker.parsers.elements.dependency_spec import RequiredDesignUnit |
63 | 63 | from hdl_checker.parsers.elements.design_unit import ( |
|
70 | 70 | from hdl_checker.types import Location |
71 | 71 | from hdl_checker.utils import ON_WINDOWS |
72 | 72 |
|
73 | | - |
74 | | -# Debouncing will hurt testing since it won't actually call the debounced |
75 | | -# function if we call it too quickly. |
76 | | -def noDebounce(interval_s, keyed_by=None): # pylint: disable=unused-argument |
77 | | - def wrapper(func): |
78 | | - def debounced(*args, **kwargs): |
79 | | - result = func(*args, **kwargs) |
80 | | - _logger.info("%s(%s, %s) returned %s", func.__name__, args, kwargs, result) |
81 | | - return result |
82 | | - |
83 | | - return debounced |
84 | | - |
85 | | - return wrapper |
86 | | - |
87 | | - |
88 | | -# This has to come before import hdl_checker.lsp |
89 | | -import hdl_checker # isort:skip |
90 | | - |
91 | | -hdl_checker.utils.debounce = noDebounce |
92 | | -from hdl_checker import lsp # isort:skip |
93 | | - |
94 | 73 | _logger = logging.getLogger(__name__) |
95 | 74 |
|
96 | 75 | TEST_TEMP_PATH = getTestTempPath(__name__) |
@@ -269,7 +248,11 @@ def checkLintFileOnMethod( |
269 | 248 | with patch.object( |
270 | 249 | self.server.checker, "getMessagesByPath", return_value=list(expected_diags), |
271 | 250 | ): |
272 | | - self.client.lsp.send_request(method, params).result(LSP_REQUEST_TIMEOUT) |
| 251 | + hdl_checker.utils.ENABLE_DEBOUNCE = False |
| 252 | + try: |
| 253 | + self.client.lsp.send_request(method, params).result(LSP_REQUEST_TIMEOUT) |
| 254 | + finally: |
| 255 | + hdl_checker.utils.ENABLE_DEBOUNCE = True |
273 | 256 |
|
274 | 257 | self.assertTrue( |
275 | 258 | self.client_diagnostics, "Expected client to have diagnostics" |
|
0 commit comments