From 8c114ed58952341142aaabc9d3f41ab3bee50887 Mon Sep 17 00:00:00 2001 From: Pavel Minaev Date: Tue, 11 Feb 2020 17:01:30 -0800 Subject: [PATCH] Purge all mentions of "IDE", and replace with "client" or "clients" as appropriate. Blacken code. --- src/debugpy/adapter/__main__.py | 18 +++---- src/debugpy/adapter/{ide.py => clients.py} | 53 ++++++++++---------- src/debugpy/adapter/components.py | 6 +-- src/debugpy/adapter/launchers.py | 23 ++++----- src/debugpy/adapter/servers.py | 24 ++++----- src/debugpy/adapter/sessions.py | 41 ++++++++++------ src/debugpy/common/sockets.py | 5 +- src/debugpy/server/cli.py | 2 +- src/debugpy/server/options.py | 57 ---------------------- tests/debug/session.py | 4 +- tests/debugpy/test_args.py | 2 +- tests/debugpy/test_attach.py | 9 +++- tests/debugpy/test_breakpoints.py | 1 + tests/debugpy/test_exclude_rules.py | 1 - tests/debugpy/test_vs_specific.py | 2 +- 15 files changed, 99 insertions(+), 149 deletions(-) rename src/debugpy/adapter/{ide.py => clients.py} (92%) delete mode 100644 src/debugpy/server/options.py diff --git a/src/debugpy/adapter/__main__.py b/src/debugpy/adapter/__main__.py index ed613344..f4ab6154 100644 --- a/src/debugpy/adapter/__main__.py +++ b/src/debugpy/adapter/__main__.py @@ -22,7 +22,7 @@ __file__ = os.path.abspath(__file__) def main(args): from debugpy import adapter from debugpy.common import compat, log, sockets - from debugpy.adapter import ide, servers, sessions + from debugpy.adapter import clients, servers, sessions if args.for_server is not None: if os.name == "posix": @@ -58,15 +58,13 @@ def main(args): else: endpoints = {"server": {"host": server_host, "port": server_port}} try: - ide_host, ide_port = ide.serve(args.host, args.port) + client_host, client_port = clients.serve(args.host, args.port) except Exception as exc: if args.for_server is None: raise - endpoints = { - "error": "Can't listen for IDE connections: " + str(exc) - } + endpoints = {"error": "Can't listen for client connections: " + str(exc)} else: - endpoints["client"] = {"host": ide_host, "port": ide_port} + endpoints["client"] = {"host": client_host, "port": client_port} if args.for_server is not None: log.info( @@ -96,9 +94,7 @@ def main(args): listener_file = os.getenv("DEBUGPY_ADAPTER_ENDPOINTS") if listener_file is not None: - log.info( - "Writing endpoints info to {0!r}:\n{1!j}", listener_file, endpoints - ) + log.info("Writing endpoints info to {0!r}:\n{1!j}", listener_file, endpoints) def delete_listener_file(): log.info("Listener ports closed; deleting {0!r}", listener_file) @@ -115,13 +111,13 @@ def main(args): raise log.exception("Error writing endpoints info to file:") if args.port is None: - ide.IDE("stdio") + clients.Client("stdio") # These must be registered after the one above, to ensure that the listener sockets # are closed before the endpoint info file is deleted - this way, another process # can wait for the file to go away as a signal that the ports are no longer in use. atexit.register(servers.stop_serving) - atexit.register(ide.stop_serving) + atexit.register(clients.stop_serving) servers.wait_until_disconnected() log.info("All debug servers disconnected; waiting for remaining sessions...") diff --git a/src/debugpy/adapter/ide.py b/src/debugpy/adapter/clients.py similarity index 92% rename from src/debugpy/adapter/ide.py rename to src/debugpy/adapter/clients.py index 2ff05173..df7ab071 100644 --- a/src/debugpy/adapter/ide.py +++ b/src/debugpy/adapter/clients.py @@ -13,8 +13,8 @@ from debugpy.common.compat import unicode from debugpy.adapter import components, servers, sessions -class IDE(components.Component): - """Handles the IDE side of a debug session.""" +class Client(components.Component): + """Handles the client side of a debug session.""" message_handler = components.Component.message_handler @@ -36,7 +36,7 @@ class IDE(components.Component): def __init__(self, sock): if sock == "stdio": - log.info("Connecting to IDE over stdio...", self) + log.info("Connecting to client over stdio...", self) stream = messaging.JsonIOStream.from_stdio() # Make sure that nothing else tries to interfere with the stdio streams # that are going to be used for DAP communication from now on. @@ -46,22 +46,22 @@ class IDE(components.Component): stream = messaging.JsonIOStream.from_socket(sock) with sessions.Session() as session: - super(IDE, self).__init__(session, stream) + super(Client, self).__init__(session, stream) self.client_id = None """ID of the connecting client. This can be 'test' while running tests.""" self.has_started = False - """Whether the "launch" or "attach" request was received from the IDE, and + """Whether the "launch" or "attach" request was received from the client, and fully handled. """ self.start_request = None - """The "launch" or "attach" request as received from the IDE. + """The "launch" or "attach" request as received from the client. """ self._initialize_request = None - """The "initialize" request as received from the IDE, to propagate to the + """The "initialize" request as received from the client, to propagate to the server later.""" self._deferred_events = [] @@ -70,11 +70,11 @@ class IDE(components.Component): """ self._known_subprocesses = set() - """servers.Connection instances for subprocesses that this IDE has been + """servers.Connection instances for subprocesses that this client has been made aware of. """ - session.ide = self + session.client = self session.register() # For the transition period, send the telemetry events with both old and new @@ -97,26 +97,26 @@ class IDE(components.Component): ) def propagate_after_start(self, event): - # pydevd starts sending events as soon as we connect, but the IDE doesn't + # pydevd starts sending events as soon as we connect, but the client doesn't # expect to see any until it receives the response to "launch" or "attach" - # request. If IDE is not ready yet, save the event instead of propagating + # request. If client is not ready yet, save the event instead of propagating # it immediately. if self._deferred_events is not None: self._deferred_events.append(event) log.debug("Propagation deferred.") else: - self.ide.channel.propagate(event) + self.client.channel.propagate(event) def _propagate_deferred_events(self): - log.debug("Propagating deferred events to {0}...", self.ide) + log.debug("Propagating deferred events to {0}...", self.client) for event in self._deferred_events: log.debug("Propagating deferred {0}", event.describe()) - self.ide.channel.propagate(event) - log.info("All deferred events propagated to {0}.", self.ide) + self.client.channel.propagate(event) + log.info("All deferred events propagated to {0}.", self.client) self._deferred_events = None - # Generic event handler. There are no specific handlers for IDE events, because - # there are no events from the IDE in DAP - but we propagate them if we can, in + # Generic event handler. There are no specific handlers for client events, because + # there are no events from the client in DAP - but we propagate them if we can, in # case some events appear in future protocol versions. @message_handler def event(self, event): @@ -166,7 +166,6 @@ class IDE(components.Component): # See https://github.com/microsoft/vscode/issues/4902#issuecomment-368583522 # for the sequence of request and events necessary to orchestrate the start. def _start_message_handler(f): - @components.Component.message_handler def handle(self, request): assert request.is_request("launch", "attach") @@ -195,7 +194,9 @@ class IDE(components.Component): # The launcher is doing output redirection, so we don't need the # server to do it, as well. arguments = dict(arguments) - arguments["debugOptions"] = list(debug_options - {"RedirectOutput"}) + arguments["debugOptions"] = list( + debug_options - {"RedirectOutput"} + ) if arguments.get("redirectOutput"): arguments = dict(arguments) @@ -232,7 +233,7 @@ class IDE(components.Component): }, ) - # Let the IDE know that it can begin configuring the adapter. + # Let the client know that it can begin configuring the adapter. self.channel.send_event("initialized") self.start_request = request @@ -310,12 +311,12 @@ class IDE(components.Component): # # If neither is specified, and "waitForAttach" is false, this is attach-by-socket # in which the server has spawned the adapter via debugpy.listen(). There - # is no PID known to the IDE in advance, but the server connection should be + # is no PID known to the client in advance, but the server connection should be # either be there already, or the server should be connecting shortly, so there # must be a timeout. # # In the last two cases, if there's more than one server connection already, - # this is a multiprocess re-attach. The IDE doesn't know the PID, so we just + # this is a multiprocess re-attach. The client doesn't know the PID, so we just # connect it to the oldest server connection that we have - in most cases, it # will be the one for the root debuggee process, but if it has exited already, # it will be some subprocess. @@ -379,7 +380,7 @@ class IDE(components.Component): self.start_request.respond({}) self._propagate_deferred_events() - # Notify the IDE of any child processes of the debuggee that aren't already + # Notify the client of any child processes of the debuggee that aren't already # being debugged. for conn in servers.connections(): if conn.server is None and conn.ppid == self.session.pid: @@ -418,7 +419,7 @@ class IDE(components.Component): @message_handler def terminate_request(self, request): - self.session.finalize('IDE requested "terminate"', terminate_debuggee=True) + self.session.finalize('client requested "terminate"', terminate_debuggee=True) return {} @message_handler @@ -426,7 +427,7 @@ class IDE(components.Component): terminate_debuggee = request("terminateDebuggee", bool, optional=True) if terminate_debuggee == (): terminate_debuggee = None - self.session.finalize('IDE requested "disconnect"', terminate_debuggee) + self.session.finalize('client requested "disconnect"', terminate_debuggee) return {} def notify_of_subprocess(self, conn): @@ -460,7 +461,7 @@ class IDE(components.Component): def serve(host, port): global listener - listener = sockets.serve("IDE", IDE, host, port) + listener = sockets.serve("Client", Client, host, port) return listener.getsockname() diff --git a/src/debugpy/adapter/components.py b/src/debugpy/adapter/components.py index 8cf33966..17a0fd86 100644 --- a/src/debugpy/adapter/components.py +++ b/src/debugpy/adapter/components.py @@ -20,7 +20,7 @@ class ComponentNotAvailable(Exception): class Component(util.Observable): - """A component managed by a debug adapter: IDE, launcher, or debug server. + """A component managed by a debug adapter: client, launcher, or debug server. Every component belongs to a Session, which is used for synchronization and shared data. @@ -65,8 +65,8 @@ class Component(util.Observable): return fmt("{0}[{1}]", type(self).__name__, self.session.id) @property - def ide(self): - return self.session.ide + def client(self): + return self.session.client @property def launcher(self): diff --git a/src/debugpy/adapter/launchers.py b/src/debugpy/adapter/launchers.py index 0701e40c..236b5c34 100644 --- a/src/debugpy/adapter/launchers.py +++ b/src/debugpy/adapter/launchers.py @@ -34,16 +34,16 @@ class Launcher(components.Component): @message_handler def process_event(self, event): self.pid = event("systemProcessId", int) - self.ide.propagate_after_start(event) + self.client.propagate_after_start(event) @message_handler def output_event(self, event): - self.ide.propagate_after_start(event) + self.client.propagate_after_start(event) @message_handler def exited_event(self, event): self.exit_code = event("exitCode", int) - # We don't want to tell the IDE about this just yet, because it will then + # We don't want to tell the client about this just yet, because it will then # want to disconnect, and the launcher might still be waiting for keypress # (if wait-on-exit was enabled). Instead, we'll report the event when we # receive "terminated" from the launcher, right before it exits. @@ -51,7 +51,7 @@ class Launcher(components.Component): @message_handler def terminated_event(self, event): try: - self.ide.channel.send_event("exited", {"exitCode": self.exit_code}) + self.client.channel.send_event("exited", {"exitCode": self.exit_code}) except Exception: pass self.channel.close() @@ -94,7 +94,7 @@ def spawn_debuggee(session, start_request, sudo, args, console, console_title): if console == "internalConsole": log.info("{0} spawning launcher: {1!r}", session, cmdline) - # If we are talking to the IDE over stdio, sys.stdin and sys.stdout are + # If we are talking to the client over stdio, sys.stdin and sys.stdout are # redirected to avoid mangling the DAP message stream. Make sure the # launcher also respects that. subprocess.Popen( @@ -107,12 +107,9 @@ def spawn_debuggee(session, start_request, sudo, args, console, console_title): else: log.info('{0} spawning launcher via "runInTerminal" request.', session) - session.ide.capabilities.require("supportsRunInTerminalRequest") - kinds = { - "integratedTerminal": "integrated", - "externalTerminal": "external", - } - session.ide.channel.request( + session.client.capabilities.require("supportsRunInTerminalRequest") + kinds = {"integratedTerminal": "integrated", "externalTerminal": "external"} + session.client.channel.request( "runInTerminal", { "kind": kinds[console], @@ -124,9 +121,7 @@ def spawn_debuggee(session, start_request, sudo, args, console, console_title): if not session.wait_for(lambda: session.launcher, timeout=10): raise start_request.cant_handle( - '{0} timed out waiting for {1} to connect', - session, - session.launcher, + "{0} timed out waiting for {1} to connect", session, session.launcher ) try: diff --git a/src/debugpy/adapter/servers.py b/src/debugpy/adapter/servers.py index 7f5284e4..09034e6a 100644 --- a/src/debugpy/adapter/servers.py +++ b/src/debugpy/adapter/servers.py @@ -136,11 +136,11 @@ if 'debugpy' not in sys.modules: log.info("No active debug session for parent process of {0}.", self) else: try: - parent_session.ide.notify_of_subprocess(self) + parent_session.client.notify_of_subprocess(self) except Exception: - # This might fail if the IDE concurrently disconnects from the parent + # This might fail if the client concurrently disconnects from the parent # session. We still want to keep the connection around, in case the - # IDE reconnects later. If the parent session was "launch", it'll take + # client reconnects later. If the parent session was "launch", it'll take # care of closing the remaining server connections. log.exception("Failed to notify parent session about {0}:", self) @@ -159,7 +159,7 @@ if 'debugpy' not in sys.modules: def request(self, request): raise request.isnt_valid( - "Requests from the debug server to the IDE are not allowed." + "Requests from the debug server to the client are not allowed." ) def event(self, event): @@ -273,16 +273,16 @@ class Server(components.Component): # Do not delegate requests from the server by default. There is a security # boundary between the server and the adapter, and we cannot trust arbitrary # requests sent over that boundary, since they may contain arbitrary code - # that the IDE will execute - e.g. "runInTerminal". The adapter must only + # that the client will execute - e.g. "runInTerminal". The adapter must only # propagate requests that it knows are safe. raise request.isnt_valid( - "Requests from the debug server to the IDE are not allowed." + "Requests from the debug server to the client are not allowed." ) # Generic event handler, used if there's no specific handler below. @message_handler def event(self, event): - self.ide.propagate_after_start(event) + self.client.propagate_after_start(event) @message_handler def initialized_event(self, event): @@ -293,7 +293,7 @@ class Server(components.Component): def process_event(self, event): # If there is a launcher, it's handling the process event. if not self.launcher: - self.ide.propagate_after_start(event) + self.client.propagate_after_start(event) @message_handler def continued_event(self, event): @@ -306,7 +306,7 @@ class Server(components.Component): # in "launch" or "attach" request, which defaults to true. If explicitly set # to false, pydevd will only resume the thread that was stepping. # - # To ensure that the IDE is aware that other threads are getting resumed in + # To ensure that the client is aware that other threads are getting resumed in # that mode, pydevd sends a "continued" event with "allThreadsResumed": true. # when responding to a step request. This ensures correct behavior in VSCode # and other DAP-conformant clients. @@ -316,14 +316,14 @@ class Server(components.Component): # does not expect to see "continued" events explicitly reflecting that fact. # If such events are sent regardless, VS behaves erratically. Thus, we have # to suppress them specifically for VS. - if self.ide.client_id not in ("visualstudio", "vsformac"): - self.ide.propagate_after_start(event) + if self.client.client_id not in ("visualstudio", "vsformac"): + self.client.propagate_after_start(event) @message_handler def exited_event(self, event): # If there is a launcher, it's handling the exit code. if not self.launcher: - self.ide.propagate_after_start(event) + self.client.propagate_after_start(event) @message_handler def terminated_event(self, event): diff --git a/src/debugpy/adapter/sessions.py b/src/debugpy/adapter/sessions.py index ce6d6dc5..8c8cff0e 100644 --- a/src/debugpy/adapter/sessions.py +++ b/src/debugpy/adapter/sessions.py @@ -20,16 +20,16 @@ _sessions_changed = threading.Event() class Session(util.Observable): - """A debug session involving an IDE, an adapter, a launcher, and a debug server. + """A debug session involving a client, an adapter, a launcher, and a debug server. - The IDE and the adapter are always present, and at least one of launcher and debug + The client and the adapter are always present, and at least one of launcher and debug server is present, depending on the scenario. """ _counter = itertools.count(1) def __init__(self): - from debugpy.adapter import ide + from debugpy.adapter import clients super(Session, self).__init__() @@ -37,8 +37,8 @@ class Session(util.Observable): self.id = next(self._counter) self._changed_condition = threading.Condition(self.lock) - self.ide = components.missing(self, ide.IDE) - """The IDE component. Always present.""" + self.client = components.missing(self, clients.Client) + """The client component. Always present.""" self.launcher = components.missing(self, launchers.Launcher) """The launcher componet. Always present in "launch" sessions, and never @@ -87,7 +87,7 @@ class Session(util.Observable): # A session is considered ended once all components disconnect, and there # are no further incoming messages from anything to handle. - components = self.ide, self.launcher, self.server + components = self.client, self.launcher, self.server if all(not com or not com.is_connected for com in components): with _lock: if self in _sessions: @@ -101,7 +101,7 @@ class Session(util.Observable): The predicate is invoked with the session locked. If satisfied, the method returns immediately. Otherwise, the lock is released (even if it was held at entry), and the method blocks waiting for some attribute of either self, - self.ide, self.server, or self.launcher to change. On every change, session + self.client, self.server, or self.launcher to change. On every change, session is re-locked and predicate is re-evaluated, until it is satisfied. While the session is unlocked, message handlers for components other than @@ -144,7 +144,7 @@ class Session(util.Observable): value of terminate; waits for it to disconnect, allowing any remaining messages from it to be handled; and closes the launcher channel. - If the IDE is present, sends "terminated" event to it. + If the client is present, sends "terminated" event to it. If terminate_debuggee=None, it is treated as True if the session has a Launcher component, and False otherwise. @@ -169,7 +169,7 @@ class Session(util.Observable): log.info("{0} finalized.", self) def _finalize(self, why, terminate_debuggee): - # If the IDE started a session, and then disconnected before issuing "launch" + # If the client started a session, and then disconnected before issuing "launch" # or "attach", the main thread will be blocked waiting for the first server # connection to come in - unblock it, so that we can exit. servers.dont_wait_for_first_connection() @@ -217,18 +217,23 @@ class Session(util.Observable): except Exception: log.exception() - if self.ide: - if self.ide.is_connected: - # Tell the IDE that debugging is over, but don't close the channel until it + if self.client: + if self.client.is_connected: + # Tell the client that debugging is over, but don't close the channel until it # tells us to, via the "disconnect" request. try: - self.ide.channel.send_event("terminated") + self.client.channel.send_event("terminated") except Exception: pass - if self.ide.start_request is not None and self.ide.start_request.command == "launch": + if ( + self.client.start_request is not None + and self.client.start_request.command == "launch" + ): servers.stop_serving() - log.info('"launch" session ended - killing remaining debuggee processes.') + log.info( + '"launch" session ended - killing remaining debuggee processes.' + ) pids_killed = set() if self.launcher and self.launcher.pid is not None: @@ -236,7 +241,11 @@ class Session(util.Observable): pids_killed.add(self.launcher.pid) while True: - conns = [conn for conn in servers.connections() if conn.pid not in pids_killed] + conns = [ + conn + for conn in servers.connections() + if conn.pid not in pids_killed + ] if not len(conns): break for conn in conns: diff --git a/src/debugpy/common/sockets.py b/src/debugpy/common/sockets.py index a9b73186..335cf942 100644 --- a/src/debugpy/common/sockets.py +++ b/src/debugpy/common/sockets.py @@ -69,10 +69,7 @@ def serve(name, handler, host, port=0, backlog=socket.SOMAXCONN, timeout=None): listener = create_server(host, port, backlog, timeout) except Exception: raise log.exception( - "Error listening for incoming {0} connections on {1}:{2}:", - name, - host, - port, + "Error listening for incoming {0} connections on {1}:{2}:", name, host, port ) host, port = listener.getsockname() log.info("Listening for incoming {0} connections on {1}:{2}...", name, host, port) diff --git a/src/debugpy/server/cli.py b/src/debugpy/server/cli.py index 281d5fe8..09dabc8c 100644 --- a/src/debugpy/server/cli.py +++ b/src/debugpy/server/cli.py @@ -157,7 +157,7 @@ switches = [ ("--wait-for-client", None, set_const("wait_for_client", True)), ("--configure-.+", "", set_config), - # Switches that are used internally by the IDE or debugpy itself. + # Switches that are used internally by the client or debugpy itself. ("--connect", "
", set_address("connect")), ("--adapter-access-token", "", set_arg("adapter_access_token")), diff --git a/src/debugpy/server/options.py b/src/debugpy/server/options.py deleted file mode 100644 index 9a1c077f..00000000 --- a/src/debugpy/server/options.py +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See LICENSE in the project root -# for license information. - -from __future__ import absolute_import, division, print_function, unicode_literals - -"""Global server options that are set via command line, environment variables, -or configuration files. -""" - -target_kind = None -"""One of: None, 'file', 'module', 'code', or 'pid'. -""" - -target = None -"""Specifies what to debug. - -If target_kind is None, then target is None, indicating that the current process -is the one that is initiating debugger attach to itself. - -If target_kind is 'file', then target is a path to the file to run. - -If target_kind is 'module', then target is the qualified name of the module to run. - -If target_kind is 'code', then target is the code to run. - -If target_kind is 'pid', then target is the process ID to attach to. -""" - -host = "127.0.0.1" -"""Name or IP address of the network interface used by debugpy.server. If runing in server -mode, this is the interface on which it listens for incoming connections. If running -in client mode, this is the interface to which it connects. -""" - -port = 5678 -"""Port number used by debugpy.server. If running in server mode, this is the port on which it -listens for incoming connections. If running in client mode, this is port to which it -connects. -""" - -client = False -"""If True, this instance of debugpy is operating in client mode - i.e. it connects -to the IDE, instead of waiting for an incoming connection from the IDE. -""" - -wait = False -"""If True, wait until the debugger is connected before running any code." -""" - -multiprocess = True -"""Whether this debugpy instance is running in multiprocess mode, detouring creation -of new processes and enabling debugging for them. -""" - -client_access_token = None -"""Access token to authenticate with the adapter.""" diff --git a/tests/debug/session.py b/tests/debug/session.py index 7ce92935..486e2200 100644 --- a/tests/debug/session.py +++ b/tests/debug/session.py @@ -384,7 +384,9 @@ class Session(object): os.close(fd) def wait_for_adapter_socket(self): - log.info("Waiting for {0} to open the IDE listener socket...", self.adapter_id) + log.info( + "Waiting for {0} to open the client listener socket...", self.adapter_id + ) while not self.adapter_endpoints.check(): time.sleep(0.1) diff --git a/tests/debugpy/test_args.py b/tests/debugpy/test_args.py index c0070690..6a74b97f 100644 --- a/tests/debugpy/test_args.py +++ b/tests/debugpy/test_args.py @@ -19,7 +19,7 @@ def test_args(pyfile, target, run): import sys import debuggee from debuggee import backchannel - + debuggee.setup() backchannel.send(sys.argv) diff --git a/tests/debugpy/test_attach.py b/tests/debugpy/test_attach.py index 1bb63b13..230d497d 100644 --- a/tests/debugpy/test_attach.py +++ b/tests/debugpy/test_attach.py @@ -58,7 +58,14 @@ def test_attach_api(pyfile, target, wait_for_client, is_client_connected, stop_m backchannel = session.open_backchannel() session.spawn_debuggee( - [code_to_debug, host, port, wait_for_client, is_client_connected, stop_method] + [ + code_to_debug, + host, + port, + wait_for_client, + is_client_connected, + stop_method, + ] ) session.wait_for_adapter_socket() diff --git a/tests/debugpy/test_breakpoints.py b/tests/debugpy/test_breakpoints.py index bffa8af4..d31df207 100644 --- a/tests/debugpy/test_breakpoints.py +++ b/tests/debugpy/test_breakpoints.py @@ -114,6 +114,7 @@ def test_crossfile_breakpoint(pyfile, target, run): import debuggee debuggee.setup() + def do_something(): print("do something") # @bp diff --git a/tests/debugpy/test_exclude_rules.py b/tests/debugpy/test_exclude_rules.py index dde2c652..2d6f9ba9 100644 --- a/tests/debugpy/test_exclude_rules.py +++ b/tests/debugpy/test_exclude_rules.py @@ -65,7 +65,6 @@ def test_exceptions_and_exclude_rules(pyfile, target, run, scenario, exc_type): @pytest.mark.parametrize("scenario", ["exclude_code_to_debug", "exclude_callback_dir"]) def test_exceptions_and_partial_exclude_rules(pyfile, target, run, scenario): - @pyfile def code_to_debug(): import debuggee diff --git a/tests/debugpy/test_vs_specific.py b/tests/debugpy/test_vs_specific.py index 444cac2b..8ae44d55 100644 --- a/tests/debugpy/test_vs_specific.py +++ b/tests/debugpy/test_vs_specific.py @@ -66,7 +66,7 @@ def test_module_events(pyfile, target, run): @pyfile def test_code(): import debuggee - + debuggee.setup() from module1 import do_something