[lldb-dap][NFC] Use wildcard imports for test decorators - #216235
Conversation
|
@llvm/pr-subscribers-lldb Author: Ebuka Ezike (da-viper) ChangesReplace explicit imports This lets downstream forks introduce extra decorators (e.g. to skip tests on private configurations) or additional util helpers without needing to patch each test's import list. Patch is 49.72 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/216235.diff 68 Files Affected:
diff --git a/lldb/test/API/tools/lldb-dap/attach-commands/TestDAP_attachCommands.py b/lldb/test/API/tools/lldb-dap/attach-commands/TestDAP_attachCommands.py
index 97ee08c6fab14..1b5a91e6d7f3c 100644
--- a/lldb/test/API/tools/lldb-dap/attach-commands/TestDAP_attachCommands.py
+++ b/lldb/test/API/tools/lldb-dap/attach-commands/TestDAP_attachCommands.py
@@ -2,9 +2,9 @@
Test lldb-dap attach commands
"""
-from lldbsuite.test.decorators import skipIfNetBSD, skipIfWasm
+from lldbsuite.test.decorators import *
from lldbsuite.test.tools.lldb_dap import DAPTestCaseBase
-from lldbsuite.test.tools.lldb_dap.types import AttachArgs, PauseArgs
+from lldbsuite.test.tools.lldb_dap.types import *
class TestDAP_attachCommands(DAPTestCaseBase):
diff --git a/lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py b/lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py
index 9baec029c45a4..5e70d077bf78a 100644
--- a/lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py
+++ b/lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py
@@ -7,19 +7,9 @@
from pathlib import Path
from lldbsuite.test import lldbutil
-from lldbsuite.test.decorators import (
- expectedFailureWindows,
- expectedFailureWindowsAndNoLLDBServer,
- requireNotWasm,
- skipIf,
- skipIfWindowsAndLLDBServer,
-)
+from lldbsuite.test.decorators import *
from lldbsuite.test.tools.lldb_dap import DAPTestCaseBase
-from lldbsuite.test.tools.lldb_dap.types import (
- AttachArgs,
- ProcessEvent,
- ProgressStartEvent,
-)
+from lldbsuite.test.tools.lldb_dap.types import *
# Often fails on Arm Linux, but not specifically because it's Arm, something in
diff --git a/lldb/test/API/tools/lldb-dap/attach/TestDAP_attachByPortNum.py b/lldb/test/API/tools/lldb-dap/attach/TestDAP_attachByPortNum.py
index 22129996ddd3e..99638a9847cbb 100644
--- a/lldb/test/API/tools/lldb-dap/attach/TestDAP_attachByPortNum.py
+++ b/lldb/test/API/tools/lldb-dap/attach/TestDAP_attachByPortNum.py
@@ -6,10 +6,10 @@
from lldbgdbserverutils import Pipe
from lldbsuite.test import lldbplatformutil
-from lldbsuite.test.decorators import skipIfNetBSD, skipIfWasm, skipIfWindows
-from lldbsuite.test.lldbtest import line_number
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
from lldbsuite.test.tools.lldb_dap import DAPTestCaseBase
-from lldbsuite.test.tools.lldb_dap.types import AttachArgs
+from lldbsuite.test.tools.lldb_dap.types import *
import lldb
diff --git a/lldb/test/API/tools/lldb-dap/breakpoint-assembly/TestDAP_breakpointAssembly.py b/lldb/test/API/tools/lldb-dap/breakpoint-assembly/TestDAP_breakpointAssembly.py
index 9bc3d989ca4f6..992bd32522b0d 100644
--- a/lldb/test/API/tools/lldb-dap/breakpoint-assembly/TestDAP_breakpointAssembly.py
+++ b/lldb/test/API/tools/lldb-dap/breakpoint-assembly/TestDAP_breakpointAssembly.py
@@ -2,7 +2,7 @@
Test lldb-dap setBreakpoints request in assembly source references.
"""
-from lldbsuite.test.decorators import skipIfWindows
+from lldbsuite.test.decorators import *
from lldbsuite.test.tools.lldb_dap.types import LaunchArgs
from lldbsuite.test.tools.lldb_dap import DAPTestCaseBase
diff --git a/lldb/test/API/tools/lldb-dap/breakpoint-events/TestDAP_breakpointEvents.py b/lldb/test/API/tools/lldb-dap/breakpoint-events/TestDAP_breakpointEvents.py
index e0057d4dba1b8..29b8987fb9ead 100644
--- a/lldb/test/API/tools/lldb-dap/breakpoint-events/TestDAP_breakpointEvents.py
+++ b/lldb/test/API/tools/lldb-dap/breakpoint-events/TestDAP_breakpointEvents.py
@@ -5,19 +5,10 @@
import os
from typing import List
-from lldbsuite.test.decorators import (
- skipIfTargetDoesNotSupportSharedLibraries,
- skipIfWindows,
-)
-from lldbsuite.test.lldbtest import line_number
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
from lldbsuite.test.tools.lldb_dap import DAPTestCaseBase
-from lldbsuite.test.tools.lldb_dap.types import (
- Breakpoint,
- BreakpointEvent,
- BreakpointReason,
- Event,
- LaunchArgs,
-)
+from lldbsuite.test.tools.lldb_dap.types import *
@skipIfTargetDoesNotSupportSharedLibraries()
diff --git a/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_breakpointLocations.py b/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_breakpointLocations.py
index a9c5a801c1f92..98091cdb0644c 100644
--- a/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_breakpointLocations.py
+++ b/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_breakpointLocations.py
@@ -4,13 +4,10 @@
import os
-from lldbsuite.test.decorators import (
- skipIfTargetDoesNotSupportSharedLibraries,
- skipIfWindows,
-)
-from lldbsuite.test.lldbtest import line_number
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
from lldbsuite.test.tools.lldb_dap import DAPTestCaseBase
-from lldbsuite.test.tools.lldb_dap.types import BreakpointLocation, LaunchArgs
+from lldbsuite.test.tools.lldb_dap.types import *
@skipIfTargetDoesNotSupportSharedLibraries()
diff --git a/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_logpoints.py b/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_logpoints.py
index 2135f179cc622..4c41f5abd81e0 100644
--- a/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_logpoints.py
+++ b/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_logpoints.py
@@ -4,18 +4,10 @@
import os
-from lldbsuite.test.decorators import (
- skipIfTargetDoesNotSupportSharedLibraries,
- skipIfWindows,
-)
-from lldbsuite.test.lldbtest import line_number
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
from lldbsuite.test.tools.lldb_dap import DAPTestCaseBase, DAPTestSession
-from lldbsuite.test.tools.lldb_dap.types import (
- LaunchArgs,
- SourceBreakpoint,
- StoppedEvent,
-)
-
+from lldbsuite.test.tools.lldb_dap.types import *
@skipIfTargetDoesNotSupportSharedLibraries()
class TestDAP_logpoints(DAPTestCaseBase):
diff --git a/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setBreakpoints.py b/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setBreakpoints.py
index 94c69436bd9b5..004b1828d6825 100644
--- a/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setBreakpoints.py
+++ b/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setBreakpoints.py
@@ -6,20 +6,10 @@
import shutil
from typing import Dict
-from lldbsuite.test.decorators import (
- skipIfTargetDoesNotSupportSharedLibraries,
- skipIfWasm,
- skipIfWindows,
-)
-from lldbsuite.test.lldbtest import line_number
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
from lldbsuite.test.tools.lldb_dap import DAPTestCaseBase
-from lldbsuite.test.tools.lldb_dap.types import (
- DAPTestGetTargetBreakpointsArgs,
- LaunchArgs,
- SetBreakpointsArgs,
- Source,
- SourceBreakpoint,
-)
+from lldbsuite.test.tools.lldb_dap.types import *
@skipIfWasm # inferior built without exception support
diff --git a/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setExceptionBreakpoints.py b/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setExceptionBreakpoints.py
index 0b1b8a6b5a541..0f11e828756c7 100644
--- a/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setExceptionBreakpoints.py
+++ b/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setExceptionBreakpoints.py
@@ -2,10 +2,7 @@
Test lldb-dap setExceptionBreakpoints request
"""
-from lldbsuite.test.decorators import (
- skipIfTargetDoesNotSupportSharedLibraries,
- skipIfWindows,
-)
+from lldbsuite.test.decorators import *
from lldbsuite.test.tools.lldb_dap import DAPTestCaseBase
from lldbsuite.test.tools.lldb_dap.types import LaunchArgs
diff --git a/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setFunctionBreakpoints.py b/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setFunctionBreakpoints.py
index 1572cab8d852e..52247eae9c94f 100644
--- a/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setFunctionBreakpoints.py
+++ b/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setFunctionBreakpoints.py
@@ -2,16 +2,9 @@
Test lldb-dap setFunctionBreakpoints request
"""
-from lldbsuite.test.decorators import (
- skipIfTargetDoesNotSupportSharedLibraries,
- skipIfWindows,
-)
+from lldbsuite.test.decorators import *
from lldbsuite.test.tools.lldb_dap import DAPTestCaseBase
-from lldbsuite.test.tools.lldb_dap.types import (
- DAPTestGetTargetBreakpointsArgs,
- FunctionBreakpoint,
- LaunchArgs,
-)
+from lldbsuite.test.tools.lldb_dap.types import *
@skipIfTargetDoesNotSupportSharedLibraries()
diff --git a/lldb/test/API/tools/lldb-dap/cancel/TestDAP_cancel.py b/lldb/test/API/tools/lldb-dap/cancel/TestDAP_cancel.py
index f639d01f851b2..5bccb04516a5c 100644
--- a/lldb/test/API/tools/lldb-dap/cancel/TestDAP_cancel.py
+++ b/lldb/test/API/tools/lldb-dap/cancel/TestDAP_cancel.py
@@ -4,9 +4,8 @@
import time
-from lldbsuite.test.tools.lldb_dap import DAPTestCaseBase
-from lldbsuite.test.tools.lldb_dap.session_helpers import DAPTestSession
-from lldbsuite.test.tools.lldb_dap.types import CancelArgs, EvaluateArgs, LaunchArgs
+from lldbsuite.test.tools.lldb_dap import DAPTestCaseBase, DAPTestSession
+from lldbsuite.test.tools.lldb_dap.types import *
class TestDAP_cancel(DAPTestCaseBase):
diff --git a/lldb/test/API/tools/lldb-dap/commands/TestDAP_commands.py b/lldb/test/API/tools/lldb-dap/commands/TestDAP_commands.py
index e79c2895fa963..e0d0f83e6803f 100644
--- a/lldb/test/API/tools/lldb-dap/commands/TestDAP_commands.py
+++ b/lldb/test/API/tools/lldb-dap/commands/TestDAP_commands.py
@@ -2,7 +2,7 @@
Test lldb-dap command hooks
"""
-from lldbsuite.test.tools.lldb_dap.types import AttachArgs, LaunchArgs
+from lldbsuite.test.tools.lldb_dap.types import *
from lldbsuite.test.tools.lldb_dap import DAPTestCaseBase
diff --git a/lldb/test/API/tools/lldb-dap/completions/TestDAP_completions.py b/lldb/test/API/tools/lldb-dap/completions/TestDAP_completions.py
index 73023e8e3cd01..6d30ec3df18bb 100644
--- a/lldb/test/API/tools/lldb-dap/completions/TestDAP_completions.py
+++ b/lldb/test/API/tools/lldb-dap/completions/TestDAP_completions.py
@@ -7,15 +7,10 @@
from typing import Optional, Union
-from lldbsuite.test.decorators import skipIf
-from lldbsuite.test.lldbtest import line_number
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
from lldbsuite.test.tools.lldb_dap import DAPTestCaseBase, DAPTestSession
-from lldbsuite.test.tools.lldb_dap.types import (
- CompletionItem,
- LaunchArgs,
- StoppedReason,
-)
-
+from lldbsuite.test.tools.lldb_dap.types import *
session_completion = CompletionItem(
label="session",
diff --git a/lldb/test/API/tools/lldb-dap/console/TestDAP_console.py b/lldb/test/API/tools/lldb-dap/console/TestDAP_console.py
index 89db508bf7c38..ade5706f0aac4 100644
--- a/lldb/test/API/tools/lldb-dap/console/TestDAP_console.py
+++ b/lldb/test/API/tools/lldb-dap/console/TestDAP_console.py
@@ -6,8 +6,8 @@
import os
import unittest
-from lldbsuite.test.decorators import requireNotWindows, requireNotWasm
-from lldbsuite.test.lldbtest import line_number
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
from lldbsuite.test.tools.lldb_dap.types import LaunchArgs
from lldbsuite.test.tools.lldb_dap import DAPTestCaseBase, DAPTestSession
from lldbsuite.test.skip_reason import UnsupportedReason
diff --git a/lldb/test/API/tools/lldb-dap/console/TestDAP_redirection_to_console.py b/lldb/test/API/tools/lldb-dap/console/TestDAP_redirection_to_console.py
index a904f77770e9a..101163d5d330f 100644
--- a/lldb/test/API/tools/lldb-dap/console/TestDAP_redirection_to_console.py
+++ b/lldb/test/API/tools/lldb-dap/console/TestDAP_redirection_to_console.py
@@ -1,10 +1,10 @@
"""Test that lldb-dap keeps stdout/stderr redirection working even when the
inferior's output is routed back through the debug console."""
-from lldbsuite.test.lldbtest import line_number
+from lldbsuite.test.lldbtest import *
from lldbsuite.test.tools.lldb_dap import DAPTestCaseBase
from lldbsuite.test.tools.lldb_dap.types import LaunchArgs
-from lldbsuite.test.tools.lldb_dap.utils import DebugAdapterOptions
+from lldbsuite.test.tools.lldb_dap.utils import *
class TestDAP_redirection_to_console(DAPTestCaseBase):
diff --git a/lldb/test/API/tools/lldb-dap/databreakpoint/TestDAP_setDataBreakpoints.py b/lldb/test/API/tools/lldb-dap/databreakpoint/TestDAP_setDataBreakpoints.py
index bd228e80746a1..9913d6ba86b16 100644
--- a/lldb/test/API/tools/lldb-dap/databreakpoint/TestDAP_setDataBreakpoints.py
+++ b/lldb/test/API/tools/lldb-dap/databreakpoint/TestDAP_setDataBreakpoints.py
@@ -2,10 +2,10 @@
Test lldb-dap dataBreakpointInfo and setDataBreakpoints requests
"""
-from lldbsuite.test.decorators import requireNotWasm, skipIfWindows
-from lldbsuite.test.lldbtest import line_number
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
from lldbsuite.test.tools.lldb_dap import DAPTestCaseBase
-from lldbsuite.test.tools.lldb_dap.types import DataBreakpoint, LaunchArgs
+from lldbsuite.test.tools.lldb_dap.types import *
@requireNotWasm("data breakpoints map to watchpoints")
diff --git a/lldb/test/API/tools/lldb-dap/disassemble/TestDAP_disassemble.py b/lldb/test/API/tools/lldb-dap/disassemble/TestDAP_disassemble.py
index 8bf1ff19cc510..d0840f382aebf 100644
--- a/lldb/test/API/tools/lldb-dap/disassemble/TestDAP_disassemble.py
+++ b/lldb/test/API/tools/lldb-dap/disassemble/TestDAP_disassemble.py
@@ -2,8 +2,8 @@
Test lldb-dap disassemble request
"""
-from lldbsuite.test.decorators import skipIfWindows
-from lldbsuite.test.lldbtest import line_number
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
from lldbsuite.test.tools.lldb_dap.types import LaunchArgs
from lldbsuite.test.tools.lldb_dap import DAPTestCaseBase
diff --git a/lldb/test/API/tools/lldb-dap/evaluate/TestDAP_evaluate.py b/lldb/test/API/tools/lldb-dap/evaluate/TestDAP_evaluate.py
index b139593c0cb9e..8d506d5319797 100644
--- a/lldb/test/API/tools/lldb-dap/evaluate/TestDAP_evaluate.py
+++ b/lldb/test/API/tools/lldb-dap/evaluate/TestDAP_evaluate.py
@@ -5,11 +5,11 @@
import re
from typing import Optional, Union
-from lldbsuite.test.decorators import skipIfWasm, skipIfWindows
-from lldbsuite.test.lldbtest import line_number
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
from lldbsuite.test.tools.lldb_dap import DAPTestCaseBase
-from lldbsuite.test.tools.lldb_dap.session_helpers import ExpectEval, FrameContext
-from lldbsuite.test.tools.lldb_dap.types import EvaluateContext, LaunchArgs, ValueFormat
+from lldbsuite.test.tools.lldb_dap.session_helpers import *
+from lldbsuite.test.tools.lldb_dap.types import *
@skipIfWasm # no expression evaluation
diff --git a/lldb/test/API/tools/lldb-dap/eventStatistic/TestDAP_eventStatistic.py b/lldb/test/API/tools/lldb-dap/eventStatistic/TestDAP_eventStatistic.py
index ed7e67b347679..1cfd5f453ed39 100644
--- a/lldb/test/API/tools/lldb-dap/eventStatistic/TestDAP_eventStatistic.py
+++ b/lldb/test/API/tools/lldb-dap/eventStatistic/TestDAP_eventStatistic.py
@@ -4,11 +4,7 @@
import json
-from lldbsuite.test.decorators import (
- skipIfRemote,
- skipIfTargetDoesNotSupportSharedLibraries,
- skipIfWindows,
-)
+from lldbsuite.test.decorators import *
from lldbsuite.test.tools.lldb_dap import DAPTestCaseBase
from lldbsuite.test.tools.lldb_dap.types import InitializedEvent, LaunchArgs
diff --git a/lldb/test/API/tools/lldb-dap/exception/TestDAP_exception.py b/lldb/test/API/tools/lldb-dap/exception/TestDAP_exception.py
index 9170118e2f309..072308c0b9538 100644
--- a/lldb/test/API/tools/lldb-dap/exception/TestDAP_exception.py
+++ b/lldb/test/API/tools/lldb-dap/exception/TestDAP_exception.py
@@ -3,7 +3,7 @@
"""
from lldbsuite.test.tools.lldb_dap import DAPTestCaseBase
-from lldbsuite.test.decorators import requireSignals
+from lldbsuite.test.decorators import *
from lldbsuite.test.tools.lldb_dap.types import LaunchArgs
diff --git a/lldb/test/API/tools/lldb-dap/exception/asan/TestDAP_asan.py b/lldb/test/API/tools/lldb-dap/exception/asan/TestDAP_asan.py
index ea7b750d90c82..e857884a93414 100644
--- a/lldb/test/API/tools/lldb-dap/exception/asan/TestDAP_asan.py
+++ b/lldb/test/API/tools/lldb-dap/exception/asan/TestDAP_asan.py
@@ -2,7 +2,7 @@
Test that we stop at runtime instrumentation locations (asan).
"""
-from lldbsuite.test.decorators import skipUnlessAddressSanitizer
+from lldbsuite.test.decorators import *
from lldbsuite.test.tools.lldb_dap.types import LaunchArgs
from lldbsuite.test.tools.lldb_dap import DAPTestCaseBase
diff --git a/lldb/test/API/tools/lldb-dap/exception/cpp/TestDAP_exception_cpp.py b/lldb/test/API/tools/lldb-dap/exception/cpp/TestDAP_exception_cpp.py
index 4cd2f8bf1e0f7..07c552140e5f0 100644
--- a/lldb/test/API/tools/lldb-dap/exception/cpp/TestDAP_exception_cpp.py
+++ b/lldb/test/API/tools/lldb-dap/exception/cpp/TestDAP_exception_cpp.py
@@ -2,8 +2,8 @@
Test exception behavior in DAP with c++ throw.
"""
-from lldbsuite.test.decorators import skipIfWasm, skipIfWindows
-from lldbsuite.test.lldbtest import line_number
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
from lldbsuite.test.tools.lldb_dap.types import LaunchArgs
from lldbsuite.test.tools.lldb_dap import DAPTestCaseBase
diff --git a/lldb/test/API/tools/lldb-dap/exception/objc/TestDAP_exception_objc.py b/lldb/test/API/tools/lldb-dap/exception/objc/TestDAP_exception_objc.py
index 5fd50882b0978..ddf710c17a700 100644
--- a/lldb/test/API/tools/lldb-dap/exception/objc/TestDAP_exception_objc.py
+++ b/lldb/test/API/tools/lldb-dap/exception/objc/TestDAP_exception_objc.py
@@ -2,8 +2,8 @@
Test exception behavior in DAP with obj-c throw.
"""
-from lldbsuite.test.decorators import requireDarwin
-from lldbsuite.test.tools.lldb_dap.types import ExceptionFilterOptions, LaunchArgs
+from lldbsuite.test.decorators import *
+from lldbsuite.test.tools.lldb_dap.types import *
from lldbsuite.test.tools.lldb_dap import DAPTestCaseBase
diff --git a/lldb/test/API/tools/lldb-dap/exception/ubsan/TestDAP_ubsan.py b/lldb/test/API/tools/lldb-dap/exception/ubsan/TestDAP_ubsan.py
index 1981823dbc1bd..8637b2016bc5c 100644
--- a/lldb/test/API/tools/lldb-dap/exception/ubsan/TestDAP_ubsan.py
+++ b/lldb/test/API/tools/lldb-dap/exception/ubsan/TestDAP_ubsan.py
@@ -2,7 +2,7 @@
Test that we stop at runtime instrumentation locations (ubsan).
"""
-from lldbsuite.test.decorators import skipUnlessUndefinedBehaviorSanitizer
+from lldbsuite.test.decorators import *
from lldbsuite.test.tools.lldb_dap.types import LaunchArgs
from lldbsuite.test.tools.lldb_dap import DAPTestCaseBase
diff --git a/lldb/test/API/tools/lldb-dap/extendedStackTrace/TestDAP_extendedStackTrace.py b/lldb/test/API/tools/lldb-dap/extendedStackTrace/TestDAP_extendedStackTrace.py
index ac7249aff00c7..493141a9dcfa9 100644
--- a/lldb/test/API/tools/lldb-dap/extendedStackTrace/TestDAP_extendedStackTrace.py
+++ b/lldb/test/API/tools/lldb-dap/extendedStackTrace/TestDAP_extendedStackTrace.py
@@ -4,11 +4,11 @@
import os
-from lldbsuite.test.decorators import requireDarwin
-from lldbsuite.test.lldbplatformutil import findBacktraceRecordingDylib
-from lldbsuite.test.lldbtest import line_number
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbplatformutil import *
+from lldbsuite.test.lldbtest import *
from lldbsuite.test.tools.lldb_dap import DAPTestCaseBase
-from lldbsuite.test.tools.lldb_dap.types import LaunchArgs, StackFrameFormat
+from lldbsuite.test.tools.lldb_dap.types import *
class TestDAP_extendedStackTrace(DAPTestCaseBase):
diff --git a/lldb/test/API/tools/lldb-dap/instruction-breakpoint/TestDAP_instruction_breakpoint.py b/lldb/test/API/tools/lldb-dap/instruction-breakpoint/TestDAP_instruction_breakpoint.py
index 9438871bd6764..dfd2efb054881 100644
--- a/lldb/test/API/tools/lldb-dap/instruction-breakpoint/TestDAP_instruction_breakpoint.py
+++ b/lldb/test/API/tools/lldb-dap/instruction-breakpoint/TestDAP_instruction_breakpoint.py
@@ -4,8 +4,8 @@
import os
-from lldbsuite.test.decorators import skipIfWindows
-from lldbsuite.test.lldbtest import line_number
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
from lldbsuite.test.tools.lldb_dap import DAPTestCaseBase
from lldbsuite.test.tools.lldb_dap.types import LaunchArgs
diff --git a/lldb/test/API/tools/lldb-da...
[truncated]
|
|
I suggest carefully considering this modification for the following reasons: First, it would cause namespace pollution in the global variable space. Second, it would make debugging more difficult. And finally, it would lead to circular dependencies between modules. |
Replace explicit imports `from ... import (a, b, c)` with wildcard imports `from ... import *` for `lldbsuite.test.decorators` This lets downstream forks introduce extra decorators (e.g. to skip tests on private configurations) without needing to patch each test's import list. [Related discourse](https://discourse.llvm.org/t/do-we-want-to-tighten-up-imports-in-the-api-testcases/91557/3)
22badc3 to
b6c4495
Compare
|
The wild card import is limited to only test decorators. |
Replace explicit imports `from ... import (a, b, c)` with wildcard imports `from ... import *` for `lldbsuite.test.decorators`, This lets downstream forks introduce extra decorators (e.g. to skip tests on private configurations) without needing to patch each test's import list. [Related discourse](https://discourse.llvm.org/t/do-we-want-to-tighten-up-imports-in-the-api-testcases/91557/3) (cherry picked from commit 3b7142c)
Replace explicit imports `from ... import (a, b, c)` with wildcard imports `from ... import *` for `lldbsuite.test.decorators`, This lets downstream forks introduce extra decorators (e.g. to skip tests on private configurations) without needing to patch each test's import list. [Related discourse](https://discourse.llvm.org/t/do-we-want-to-tighten-up-imports-in-the-api-testcases/91557/3)
Replace explicit imports
from ... import (a, b, c)with wildcard importsfrom ... import *forlldbsuite.test.decorators,This lets downstream forks introduce extra decorators (e.g. to skip tests on private configurations) without needing to patch each test's import list.
Related discourse