From 8849812f99ca0c51b91262a9a3a30f4dffcb81e8 Mon Sep 17 00:00:00 2001 From: Al Finkelstein Date: Mon, 31 Aug 2020 14:42:49 -0500 Subject: [PATCH] Auto close fetcher session --- CHANGES.md | 4 ++++ compliance/fetch.py | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 5b64b273..52365929 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,7 @@ +# UNRELEASED + +- [FIXED] ComplianceFetcher session object is auto-closed now in tearDownClass. + # 1.2.7 - [CHANGED] Removed PyYAML dependency to resolve downstream dependency issues. diff --git a/compliance/fetch.py b/compliance/fetch.py index 8b27342f..a0867063 100644 --- a/compliance/fetch.py +++ b/compliance/fetch.py @@ -28,7 +28,11 @@ class ComplianceFetcher(unittest.TestCase): """Compliance fetcher automation TestCase class.""" - _multiprocess_can_split_ = True + @classmethod + def tearDownClass(cls): + """Perform clean up.""" + if hasattr(cls, '_session'): + cls._session.close() @classmethod def session(cls, url=None, creds=None, **headers):