File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 1
1
Changelog
2
2
=========
3
3
4
+ 2.0.1
5
+ -----
6
+
7
+ - #20: Added workaround for issue with SysLogHandler.
8
+
4
9
2.0.0
5
10
-----
6
11
Original file line number Diff line number Diff line change @@ -20,12 +20,21 @@ def services_log(slave_id):
20
20
pass
21
21
logger = logging .getLogger ('[{slave_id}] {name}' .format (name = __name__ , slave_id = slave_id ))
22
22
logger .setLevel (logging .DEBUG )
23
- if handler :
23
+ if handler and workaround_issue_20 ( handler ) :
24
24
logger .propagate = 0
25
25
logger .addHandler (handler )
26
26
return logger
27
27
28
28
29
+ def workaround_issue_20 (handler ):
30
+ """
31
+ Workaround for
32
+ https://github.com/pytest-dev/pytest-services/issues/20,
33
+ disabling installation of a broken handler.
34
+ """
35
+ return hasattr (handler , 'socket' )
36
+
37
+
29
38
@contextlib .contextmanager
30
39
def dont_capture (request ):
31
40
"""Suspend capturing of stdout by pytest."""
You can’t perform that action at this time.
0 commit comments