Skip to content

Commit f673ed6

Browse files
committed
Move logging shutdown to test file
1 parent 9d9019c commit f673ed6

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ options:
8383
8484
### Testing
8585
86+
This repository currently has **92% test coverage**.
87+
8688
Test datasets are stored in [/test/data](../test/data). The script has a full test suite:
8789
* [test_samplesheet_validator.py](../test/test_samplesheet_validator.py)
8890

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
name="samplesheet_validator",
66
version=git_tag(),
77
description="Python library for samplesheet validation",
8-
url="https://github.com/moka-guys/samplesheet_validator/tree/feature/fix_stream_handler",
8+
url="https://github.com/moka-guys/samplesheet_validator",
99
author="Rachel Duffin",
1010
author_email="rachel.duffin2@nhs.net",
1111
license="Apache License, Version 2.0",

test/test_samplesheet_validator.py

+11
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@
1010
from samplesheet_validator.__main__ import is_valid_dir, is_valid_file
1111

1212

13+
def shutdown_logs(logger: object) -> None:
14+
"""
15+
To prevent duplicate filehandlers and system handlers close
16+
and remove all handlers for a logging object
17+
:return (None):
18+
"""
19+
for handler in logger.handlers[:]:
20+
logger.removeHandler(handler)
21+
handler.close()
22+
23+
1324
def get_sscheck_obj(samplesheet: str) -> object:
1425
"""
1526
Function to retrieve a samplesheet check object and carry out the

0 commit comments

Comments
 (0)