From f23e54ad8f612bc6bc9e9b28072339a3c53cae91 Mon Sep 17 00:00:00 2001 From: "Mr. Walls" Date: Fri, 12 Jul 2024 20:38:46 -0700 Subject: [PATCH 1/4] Marked early del to ignore false-positives of PYL-C0414 ( - Fixes #48 - ) --- tests/__init__.py | 4 ++-- tests/context.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index 702eb23..7eb262c 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -36,10 +36,10 @@ ImportErr = None del ImportErr raise ImportError(str("Test module failed completely.")) - from tests import context as context + from tests import context as context # skipcq: PYL-C0414 if context.__name__ is None: raise ImportError(str("Test module failed to import even the context framework.")) - from tests import profiling as profiling + from tests import profiling as profiling # skipcq: PYL-C0414 if profiling.__name__ is None: raise ImportError(str("Test module failed to import even the profiling framework.")) from tests import test_basic diff --git a/tests/context.py b/tests/context.py index 0295996..3552f41 100644 --- a/tests/context.py +++ b/tests/context.py @@ -35,7 +35,7 @@ try: - import pythonrepo as pythonrepo + import pythonrepo as pythonrepo # skipcq: PYL-C0414 if pythonrepo.__name__ is None: raise ImportError("Failed to import pythonrepo.") except Exception as badErr: From 259ffb61cea3e73646b2d74d85b1db5fd7825966 Mon Sep 17 00:00:00 2001 From: "Mr. Walls" Date: Fri, 12 Jul 2024 20:23:05 -0700 Subject: [PATCH 2/4] Marked early del to ignore false-positives of PYL-W0043 ( - Fixes #47 - ) --- tests/test_usage.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_usage.py b/tests/test_usage.py index 9dfe1eb..bcb2980 100644 --- a/tests/test_usage.py +++ b/tests/test_usage.py @@ -215,7 +215,7 @@ def test_template_case(self): print(str((err.args))) print(str("")) err = None - del err + del err # skipcq: PTC-W0043 theResult = False self.assertTrue(theResult) @@ -253,7 +253,7 @@ def test_profile_template_case(self): print(str((err.args))) print(str("")) err = None - del err + del err # skipcq: PTC-W0043 theResult = False self.assertTrue(theResult) @@ -292,7 +292,7 @@ def test_fail_template_case(self): print(str((err.args))) print(str("")) err = None - del err + del err # skipcq: PTC-W0043 theResult = False self.assertTrue(theResult) @@ -331,7 +331,7 @@ def test_bad_template_case(self): print(str((err.args))) print(str("")) err = None - del err + del err # skipcq: PTC-W0043 theResult = False self.assertTrue(theResult) From 5f11d123c4e6199225ee43bae3b2a5410c3dc1c9 Mon Sep 17 00:00:00 2001 From: "Mr. Walls" Date: Fri, 12 Jul 2024 21:05:44 -0700 Subject: [PATCH 3/4] refactor to avoid PYL-W0621 ( - Fixes #49 - ) --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index afbb91c..862e023 100755 --- a/setup.py +++ b/setup.py @@ -30,8 +30,8 @@ def readFile(filename): theResult = None if filename in ("""README.md""", """LICENSE.md"""): try: - with open(str("""./{}""").format(str(filename))) as f: - theResult = f.read() + with open(str("""./{}""").format(str(filename))) as file: + theResult = file.read() except Exception: theResult = str( """See https://github.com/reactive-firewall/python-repo/{}""" From 3566cdaf8078c2b3cbf6fab80b3514f15c9ca6bb Mon Sep 17 00:00:00 2001 From: "Mr. Walls" Date: Fri, 12 Jul 2024 21:11:10 -0700 Subject: [PATCH 4/4] comment to skip false PYL-W0622 ( - Fixes #50 - ) --- tests/profiling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/profiling.py b/tests/profiling.py index 6536ded..7b850c2 100644 --- a/tests/profiling.py +++ b/tests/profiling.py @@ -132,7 +132,7 @@ def checkpoint(self, name=''): def __enter__(self): return self - def __exit__(self, type, value, traceback): + def __exit__(self, type, value, traceback): # skipcq: PLY-W0622 self.checkpoint(str("finished")) pass