File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 25
25
26
26
MAX_BUFFER_SIZE : int = 10
27
27
28
+ def pytest_addoption (parser ):
29
+ parser .addoption ("--debug-simvue" , action = "store_true" , default = False )
30
+
31
+
28
32
class CountingLogHandler (logging .Handler ):
29
33
def __init__ (self , level = logging .DEBUG ):
30
34
super ().__init__ (level )
@@ -48,6 +52,7 @@ def clear_out_files() -> None:
48
52
49
53
for file_obj in out_files :
50
54
file_obj .unlink ()
55
+
51
56
52
57
@pytest .fixture ()
53
58
def offline_cache_setup (monkeypatch : monkeypatch .MonkeyPatch ):
@@ -113,11 +118,11 @@ def speedy_heartbeat(monkeypatch: monkeypatch.MonkeyPatch) -> None:
113
118
114
119
115
120
@pytest .fixture (autouse = True )
116
- def setup_logging () -> CountingLogHandler :
117
- logging .basicConfig (level = logging .DEBUG )
121
+ def setup_logging (pytestconfig ) -> CountingLogHandler :
122
+ logging .basicConfig (level = logging .WARNING )
118
123
handler = CountingLogHandler ()
119
- logging .getLogger ().setLevel (logging .DEBUG )
120
- logging .getLogger ().addHandler (handler )
124
+ logging .getLogger ("simvue" ).setLevel (logging .DEBUG if pytestconfig . getoption ( "debug_simvue" ) else logging . WARNING )
125
+ logging .getLogger ("simvue" ).addHandler (handler )
121
126
return handler
122
127
123
128
You can’t perform that action at this time.
0 commit comments