Skip to content

Commit ae8cfc7

Browse files
authored
Update logger initialization logic to handle running within Intellij … (#25)
* Update logger initialization logic to handle running within Intellij and running on the command line.
1 parent 2cb5a03 commit ae8cfc7

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ repos:
2626
- id: black
2727

2828
- repo: https://github.com/pre-commit/mirrors-mypy
29-
rev: v1.3.0
29+
rev: v1.4.0
3030
hooks:
3131
- id: mypy
3232

tests/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
"""Generic type for cache values"""
1818

1919
# logging configuration for tests
20-
logging.config.fileConfig(fname="tests/logging.conf", disable_existing_loggers=False)
20+
logging_config: str = "tests/logging.conf" # executing from project root
21+
if not os.path.exists(logging_config):
22+
logging_config = "logging.conf" # executing from tests directory (most likely IntelliJ)
23+
24+
logging.config.fileConfig(fname=logging_config, disable_existing_loggers=False)
2125
COH_TEST_LOG = logging.getLogger("coherence-test")
2226

2327

0 commit comments

Comments
 (0)