Skip to content

Fix ruff error: remove unused 'stop' variable in test

4cce4a6
Select commit
Loading
Failed to load commit list.
Merged

Fix: Treat __annotate__ functions as library code in Python 3.14+ #1988

Fix ruff error: remove unused 'stop' variable in test
4cce4a6
Select commit
Loading
Failed to load commit list.
Azure Pipelines / debugpy-test failed Jan 9, 2026 in 50m 13s

Build #20260109.4 had test failures

Details

Tests

  • Failed: 2 (0.01%)
  • Passed: 20,061 (81.79%)
  • Other: 4,465 (18.20%)
  • Total: 24,528

Annotations

Check failure on line 2916 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / debugpy-test

Build log #L2916

PowerShell exited with code '1'.

Check failure on line 2782 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / debugpy-test

Build log #L2782

PowerShell exited with code '1'.

Check failure on line 1 in test_thread_count[program-launch-3]

See this annotation in the file changed.

@azure-pipelines azure-pipelines / debugpy-test

test_thread_count[program-launch-3]

assert 4 == 3
 +  where 4 = len([{\n    "id": 1,\n    "name": "MainThread"\n}, {\n    "id": 2,\n    "name": "Dummy-6"\n}, {\n    "id": 3,\n    "name": "Thread-7 (worker)"\n}, {\n    "id": 4,\n    "name": "Thread-8 (worker)"\n}])
Raw output
pyfile = <function pyfile.<locals>.factory at 0x0000022E0F63EB90>
target = <class 'tests.debug.targets.Program'>, run = launch, count = 3

    @pytest.mark.parametrize("count", [1, 3])
    def test_thread_count(pyfile, target, run, count):
        @pyfile
        def code_to_debug():
            import debuggee
            import threading
            import time
            import sys
    
            debuggee.setup()
            stop = False # noqa: F841
    
            def worker(tid, offset):
                i = 0
                global stop
                while not stop:
                    time.sleep(0.01)
                    i += 1
    
            threads = []
            if sys.argv[1] != "1":
                for i in [111, 222]:
                    thread = threading.Thread(target=worker, args=(i, len(threads)))
                    threads.append(thread)
                    thread.start()
            print("check here")  # @bp
            stop = True  # noqa: F841
    
        with debug.Session() as session:
            with run(session, target(code_to_debug, args=[str(count)])):
                session.set_breakpoints(code_to_debug, all)
    
            session.wait_for_stop()
            threads = session.request("threads")
>           assert len(threads["threads"]) == count
E           assert 4 == 3
E            +  where 4 = len([{\n    "id": 1,\n    "name": "MainThread"\n}, {\n    "id": 2,\n    "name": "Dummy-6"\n}, {\n    "id": 3,\n    "name": "Thread-7 (worker)"\n}, {\n    "id": 4,\n    "name": "Thread-8 (worker)"\n}])

tests\debugpy\test_threads.py:46: AssertionError

Check failure on line 1 in test_thread_count[program-launch-1]

See this annotation in the file changed.

@azure-pipelines azure-pipelines / debugpy-test

test_thread_count[program-launch-1]

assert 2 == 1
 +  where 2 = len([{\n    "id": 1,\n    "name": "MainThread"\n}, {\n    "id": 2,\n    "name": "Dummy-6"\n}])
Raw output
pyfile = <function pyfile.<locals>.factory at 0x056809B8>
target = <class 'tests.debug.targets.Program'>, run = launch, count = 1

    @pytest.mark.parametrize("count", [1, 3])
    def test_thread_count(pyfile, target, run, count):
        @pyfile
        def code_to_debug():
            import debuggee
            import threading
            import time
            import sys
    
            debuggee.setup()
            stop = False # noqa: F841
    
            def worker(tid, offset):
                i = 0
                global stop
                while not stop:
                    time.sleep(0.01)
                    i += 1
    
            threads = []
            if sys.argv[1] != "1":
                for i in [111, 222]:
                    thread = threading.Thread(target=worker, args=(i, len(threads)))
                    threads.append(thread)
                    thread.start()
            print("check here")  # @bp
            stop = True  # noqa: F841
    
        with debug.Session() as session:
            with run(session, target(code_to_debug, args=[str(count)])):
                session.set_breakpoints(code_to_debug, all)
    
            session.wait_for_stop()
            threads = session.request("threads")
>           assert len(threads["threads"]) == count
E           assert 2 == 1
E            +  where 2 = len([{\n    "id": 1,\n    "name": "MainThread"\n}, {\n    "id": 2,\n    "name": "Dummy-6"\n}])

tests\debugpy\test_threads.py:46: AssertionError