Skip to content

Commit ba25b12

Browse files
committed
fix: factory, not type [threading.Lock]
Signed-off-by: Damian Skrzyński <polprog.tech@gmail.com>
1 parent 5e40a1d commit ba25b12

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tests/unit/test_infrastructure_persistence.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,13 @@ class TestSSLContextThreadSafety:
209209

210210
def test_lock_exists(self):
211211
"""GIVEN the network module is imported"""
212-
import threading
213-
214212
from appsecone.shared import network
215213

216-
"""THEN _context_lock is a threading.Lock instance"""
214+
"""THEN _context_lock is a lock with acquire/release"""
217215
assert hasattr(network, "_context_lock")
218-
assert isinstance(network._context_lock, threading.Lock)
216+
lock = network._context_lock
217+
assert callable(getattr(lock, "acquire", None))
218+
assert callable(getattr(lock, "release", None))
219219

220220
class TestStructuredErrorPages:
221221
"""Error pages include navigation and status code."""

0 commit comments

Comments
 (0)