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 2525
2626MAX_BUFFER_SIZE : int = 10
2727
28+ def pytest_addoption (parser ):
29+ parser .addoption ("--debug-simvue" , action = "store_true" , default = False )
30+
31+
2832class CountingLogHandler (logging .Handler ):
2933 def __init__ (self , level = logging .DEBUG ):
3034 super ().__init__ (level )
@@ -48,6 +52,7 @@ def clear_out_files() -> None:
4852
4953 for file_obj in out_files :
5054 file_obj .unlink ()
55+
5156
5257@pytest .fixture ()
5358def offline_cache_setup (monkeypatch : monkeypatch .MonkeyPatch ):
@@ -113,11 +118,11 @@ def speedy_heartbeat(monkeypatch: monkeypatch.MonkeyPatch) -> None:
113118
114119
115120@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 )
118123 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 )
121126 return handler
122127
123128
You can’t perform that action at this time.
0 commit comments