Skip to content

[lldb-dap][NFC] Use wildcard imports for test decorators - #216235

Merged
da-viper merged 1 commit into
llvm:mainfrom
da-viper:cleanup-imports
Aug 14, 2026
Merged

[lldb-dap][NFC] Use wildcard imports for test decorators#216235
da-viper merged 1 commit into
llvm:mainfrom
da-viper:cleanup-imports

Conversation

@da-viper

@da-viper da-viper commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

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

@llvmorg-github-actions

Copy link
Copy Markdown

@llvm/pr-subscribers-lldb

Author: Ebuka Ezike (da-viper)

Changes

Replace explicit imports from ... import (a, b, c) with wildcard imports from ... import * for lldbsuite.test.decorators and lldbsuite.test.lldbutil.

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:

  • (modified) lldb/test/API/tools/lldb-dap/attach-commands/TestDAP_attachCommands.py (+2-2)
  • (modified) lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py (+2-12)
  • (modified) lldb/test/API/tools/lldb-dap/attach/TestDAP_attachByPortNum.py (+3-3)
  • (modified) lldb/test/API/tools/lldb-dap/breakpoint-assembly/TestDAP_breakpointAssembly.py (+1-1)
  • (modified) lldb/test/API/tools/lldb-dap/breakpoint-events/TestDAP_breakpointEvents.py (+3-12)
  • (modified) lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_breakpointLocations.py (+3-6)
  • (modified) lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_logpoints.py (+3-11)
  • (modified) lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setBreakpoints.py (+3-13)
  • (modified) lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setExceptionBreakpoints.py (+1-4)
  • (modified) lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setFunctionBreakpoints.py (+2-9)
  • (modified) lldb/test/API/tools/lldb-dap/cancel/TestDAP_cancel.py (+2-3)
  • (modified) lldb/test/API/tools/lldb-dap/commands/TestDAP_commands.py (+1-1)
  • (modified) lldb/test/API/tools/lldb-dap/completions/TestDAP_completions.py (+3-8)
  • (modified) lldb/test/API/tools/lldb-dap/console/TestDAP_console.py (+2-2)
  • (modified) lldb/test/API/tools/lldb-dap/console/TestDAP_redirection_to_console.py (+2-2)
  • (modified) lldb/test/API/tools/lldb-dap/databreakpoint/TestDAP_setDataBreakpoints.py (+3-3)
  • (modified) lldb/test/API/tools/lldb-dap/disassemble/TestDAP_disassemble.py (+2-2)
  • (modified) lldb/test/API/tools/lldb-dap/evaluate/TestDAP_evaluate.py (+4-4)
  • (modified) lldb/test/API/tools/lldb-dap/eventStatistic/TestDAP_eventStatistic.py (+1-5)
  • (modified) lldb/test/API/tools/lldb-dap/exception/TestDAP_exception.py (+1-1)
  • (modified) lldb/test/API/tools/lldb-dap/exception/asan/TestDAP_asan.py (+1-1)
  • (modified) lldb/test/API/tools/lldb-dap/exception/cpp/TestDAP_exception_cpp.py (+2-2)
  • (modified) lldb/test/API/tools/lldb-dap/exception/objc/TestDAP_exception_objc.py (+2-2)
  • (modified) lldb/test/API/tools/lldb-dap/exception/ubsan/TestDAP_ubsan.py (+1-1)
  • (modified) lldb/test/API/tools/lldb-dap/extendedStackTrace/TestDAP_extendedStackTrace.py (+4-4)
  • (modified) lldb/test/API/tools/lldb-dap/instruction-breakpoint/TestDAP_instruction_breakpoint.py (+2-2)
  • (modified) lldb/test/API/tools/lldb-dap/invalidated-event/TestDAP_invalidatedEvent.py (+2-2)
  • (modified) lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_commands.py (+2-2)
  • (modified) lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_cwd.py (+1-1)
  • (modified) lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_disableSTDIO.py (+1-1)
  • (modified) lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_environment_with_array.py (+1-1)
  • (modified) lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_environment_with_object.py (+1-1)
  • (modified) lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_extra_launch_commands.py (+2-2)
  • (modified) lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_shellExpandArguments_enabled.py (+1-1)
  • (modified) lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_stdio_redirection_and_console.py (+1-8)
  • (modified) lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_stopOnEntry.py (+1-1)
  • (modified) lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_terminate_commands.py (+1-1)
  • (modified) lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_win_debug_heap.py (+1-1)
  • (modified) lldb/test/API/tools/lldb-dap/launch/io/TestDAP_launch_io_integratedTerminal.py (+2-8)
  • (modified) lldb/test/API/tools/lldb-dap/launch/io/TestDAP_launch_io_internalConsole.py (+2-2)
  • (modified) lldb/test/API/tools/lldb-dap/locations/TestDAP_locations.py (+2-2)
  • (modified) lldb/test/API/tools/lldb-dap/longpath/TestDAP_launch_longPath.py (+2-2)
  • (modified) lldb/test/API/tools/lldb-dap/module-event/TestDAP_module_event.py (+3-6)
  • (modified) lldb/test/API/tools/lldb-dap/module/TestDAP_module.py (+3-14)
  • (modified) lldb/test/API/tools/lldb-dap/moduleSymbols/TestDAP_moduleSymbols.py (+2-2)
  • (modified) lldb/test/API/tools/lldb-dap/optimized/TestDAP_optimized.py (+2-2)
  • (modified) lldb/test/API/tools/lldb-dap/output/TestDAP_output.py (+2-2)
  • (modified) lldb/test/API/tools/lldb-dap/repl-mode/TestDAP_repl_mode_detection.py (+1-1)
  • (modified) lldb/test/API/tools/lldb-dap/restart/TestDAP_restart.py (+2-2)
  • (modified) lldb/test/API/tools/lldb-dap/restart/TestDAP_restart_console.py (+2-8)
  • (modified) lldb/test/API/tools/lldb-dap/send-event/TestDAP_sendEvent.py (+3-3)
  • (modified) lldb/test/API/tools/lldb-dap/source/TestDAP_source.py (+3-3)
  • (modified) lldb/test/API/tools/lldb-dap/stackTrace-x86/TestDAP_source_x86.py (+2-2)
  • (modified) lldb/test/API/tools/lldb-dap/stackTrace/TestDAP_stackTrace.py (+3-7)
  • (modified) lldb/test/API/tools/lldb-dap/stackTrace/subtleFrames/TestDAP_subtleFrames.py (+2-2)
  • (modified) lldb/test/API/tools/lldb-dap/stackTraceCompilerGeneratedCode/TestDAP_stackTraceCompilerGeneratedCode.py (+1-1)
  • (modified) lldb/test/API/tools/lldb-dap/stackTraceDisassemblyDisplay/TestDAP_stackTraceDisassemblyDisplay.py (+1-1)
  • (modified) lldb/test/API/tools/lldb-dap/stackTraceMissingFunctionName/TestDAP_stackTraceMissingFunctionName.py (+1-1)
  • (modified) lldb/test/API/tools/lldb-dap/stackTraceMissingModule/TestDAP_stackTraceMissingModule.py (+2-2)
  • (modified) lldb/test/API/tools/lldb-dap/step/TestDAP_step.py (+2-2)
  • (modified) lldb/test/API/tools/lldb-dap/stepInTargets/TestDAP_stepInTargets.py (+2-2)
  • (modified) lldb/test/API/tools/lldb-dap/stopped-events/TestDAP_stopped_events.py (+2-8)
  • (modified) lldb/test/API/tools/lldb-dap/terminated-event/TestDAP_terminatedEvent.py (+2-5)
  • (modified) lldb/test/API/tools/lldb-dap/threads/TestDAP_threads.py (+2-2)
  • (modified) lldb/test/API/tools/lldb-dap/utils/TestDAPUtils_EventHistory.py (+3-14)
  • (modified) lldb/test/API/tools/lldb-dap/utils/TestDAPUtils_Types.py (+1-14)
  • (modified) lldb/test/API/tools/lldb-dap/variables/TestDAP_variables.py (+3-12)
  • (modified) lldb/test/API/tools/lldb-dap/variables/children/TestDAP_variables_children.py (+2-2)
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]

@zhangweize9-cyber

Copy link
Copy Markdown
Contributor

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)
@da-viper da-viper changed the title [lldb-dap][NFC] Use wildcard imports for test decorators, utils and types. [lldb-dap][NFC] Use wildcard imports for test decorators Aug 14, 2026
@da-viper

Copy link
Copy Markdown
Contributor Author

The wild card import is limited to only test decorators.

@da-viper
da-viper merged commit 3b7142c into llvm:main Aug 14, 2026
13 checks passed
da-viper added a commit to swiftlang/llvm-project that referenced this pull request Aug 14, 2026
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)
zhangweize9-cyber pushed a commit to zhangweize9-cyber/llvm-project that referenced this pull request Aug 16, 2026
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants