-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix non-deterministic BIDS table file order in
test_table
(#29)
* Fix non-deterministic BIDS table file order Fix non-deterministic BIDS table file order and add more asserts to check the expected fields. * Add test for `setup_logging`
- Loading branch information
Showing
2 changed files
with
36 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import logging | ||
from pathlib import Path | ||
|
||
from bids2table.logging import setup_logging | ||
|
||
|
||
def test_setup_logging(tmp_path: Path): | ||
log_path = tmp_path / "log.txt" | ||
logger = setup_logging( | ||
level=logging.INFO, | ||
log_path=tmp_path / "log.txt", | ||
max_repeats=5, | ||
overwrite=True, | ||
) | ||
|
||
for ii in range(0, 10): | ||
logger.info(f"log msg {ii}") | ||
|
||
log = log_path.read_text().strip().split("\n") | ||
assert len(log) == 6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters