From fb556805d3fdaa446e6160eba466db446f3ab262 Mon Sep 17 00:00:00 2001 From: clavedeluna Date: Tue, 17 Oct 2023 07:55:36 -0300 Subject: [PATCH] add unit test --- tests/codemods/test_with_threading_lock.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/codemods/test_with_threading_lock.py b/tests/codemods/test_with_threading_lock.py index b9620144f..108272ecc 100644 --- a/tests/codemods/test_with_threading_lock.py +++ b/tests/codemods/test_with_threading_lock.py @@ -170,6 +170,21 @@ def f(l): lock = threading.Lock() with lock: print() +""", + ), + ( + """import threading +def my_func(): + lock = "whatever" + with threading.Lock(): + foo() +""", + """import threading +def my_func(): + lock = "whatever" + lock_1 = threading.Lock() + with lock_1: + foo() """, ), ],