File tree 1 file changed +12
-8
lines changed
1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change 8
8
from sentry_sdk .utils import _is_threading_local_monkey_patched
9
9
10
10
11
+ def try_gevent_patch_all ():
12
+ try :
13
+ gevent .monkey .patch_all ()
14
+ except Exception as e :
15
+ if "_RLock__owner" in str (e ):
16
+ pytest .skip ("https://github.com/gevent/gevent/issues/1380" )
17
+ else :
18
+ raise
19
+
20
+
11
21
def test_gevent_is_patched ():
12
- gevent . monkey . patch_all ()
22
+ try_gevent_patch_all ()
13
23
assert _is_threading_local_monkey_patched ()
14
24
15
25
@@ -20,13 +30,7 @@ def test_gevent_is_not_patched():
20
30
@pytest .mark .parametrize ("with_gevent" , [True , False ])
21
31
def test_leaks (with_gevent ):
22
32
if with_gevent :
23
- try :
24
- gevent .monkey .patch_all ()
25
- except Exception as e :
26
- if "_RLock__owner" in str (e ):
27
- pytest .skip ("https://github.com/gevent/gevent/issues/1380" )
28
- else :
29
- raise
33
+ try_gevent_patch_all ()
30
34
31
35
import threading
32
36
You can’t perform that action at this time.
0 commit comments