Skip to content

Commit 573442f

Browse files
committed
Configure logging under test
1 parent 747eb1f commit 573442f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/conftest.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
from pre_commit import five
1313
from pre_commit import output
14+
from pre_commit.logging_handler import add_logging_handler
1415
from pre_commit.prefixed_command_runner import PrefixedCommandRunner
1516
from pre_commit.runner import Runner
1617
from pre_commit.store import Store
@@ -90,7 +91,7 @@ def in_conflicting_submodule(tempdir_factory):
9091
yield
9192

9293

93-
@pytest.yield_fixture(scope='session', autouse=True)
94+
@pytest.yield_fixture(autouse=True, scope='session')
9495
def dont_write_to_home_directory():
9596
"""pre_commit.store.Store will by default write to the home directory
9697
We'll mock out `Store.get_default_directory` to raise invariantly so we
@@ -107,6 +108,11 @@ class YouForgotToExplicitlyChooseAStoreDirectory(AssertionError):
107108
yield
108109

109110

111+
@pytest.fixture(autouse=True, scope='session')
112+
def configure_logging():
113+
add_logging_handler(use_color=False)
114+
115+
110116
@pytest.yield_fixture
111117
def mock_out_store_directory(tempdir_factory):
112118
tmpdir = tempdir_factory.get()

0 commit comments

Comments
 (0)