11import glob
22import os
3- from threading import Lock
4- from threading import RLock
3+ import threading
54from typing import Any
65from typing import Optional
76from typing import Type
2221
2322
2423# Type aliases for supported classes
25- LockClass = Union [Type [Lock ], Type [RLock ]]
24+ LockClass = Union [Type [threading . Lock ], Type [threading . RLock ]]
2625CollectorClass = Union [Type [ThreadingLockCollector ], Type [ThreadingRLockCollector ]]
2726
2827# Module-level globals for testing global lock profiling
@@ -87,8 +86,8 @@ def test_repr(
8786@pytest .mark .parametrize (
8887 "lock_class,collector_class" ,
8988 [
90- (Lock , ThreadingLockCollector ),
91- (RLock , ThreadingRLockCollector ),
89+ (threading . Lock , ThreadingLockCollector ),
90+ (threading . RLock , ThreadingRLockCollector ),
9291 ],
9392)
9493def test_patch (
@@ -111,6 +110,7 @@ def test_patch(
111110)
112111def test_wrapt_disable_extensions ():
113112 import os
113+ import threading
114114
115115 from ddtrace .internal .datadog .profiling import ddup
116116 from ddtrace .profiling .collector import _lock
@@ -137,7 +137,7 @@ def test_wrapt_disable_extensions():
137137 assert _lock .WRAPT_C_EXT is False
138138
139139 with ThreadingLockCollector (capture_pct = 100 ):
140- th_lock = Lock () # !CREATE! test_wrapt_disable_extensions
140+ th_lock = threading . Lock () # !CREATE! test_wrapt_disable_extensions
141141 with th_lock : # !ACQUIRE! !RELEASE! test_wrapt_disable_extensions
142142 pass
143143
@@ -973,7 +973,7 @@ def collector_class(self):
973973
974974 @property
975975 def lock_class (self ):
976- return Lock
976+ return threading . Lock
977977
978978
979979class TestThreadingRLockCollector (BaseThreadingLockCollectorTest ):
@@ -985,4 +985,4 @@ def collector_class(self):
985985
986986 @property
987987 def lock_class (self ):
988- return RLock
988+ return threading . RLock
0 commit comments