-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanup dead code and fix some imports. #283
Conversation
This removes code that was here for older versions of python that we no longer support. Unused imports have been removed while missing ones have been added.
@@ -441,7 +441,7 @@ def parseArguments(argv=None): # pragma: no cover | |||
), | |||
default=argparse.SUPPRESS, | |||
) | |||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This made a tuple declaration serving no purpose.
import sys | ||
import unittest | ||
from configparser import ConfigParser | ||
from unittest.mock import patch, MagicMock, call |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These new imports are actually used which makes me feel that this part of the test code is not actually being run.
""" | ||
try: | ||
import coverage | ||
except ImportError: | ||
self.skipTest("Coverage needs to be installed for this test") | ||
self.assertTrue(coverage.version_info) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This double up as a way to 'use' coverage so linters do not complained about unused imports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I've manually validated all the import-related changes here, and removing the old python 2 related code makes sense as 3.8 is now the minimum version.
@@ -737,14 +735,6 @@ def printErrors(self): | |||
if not self.args.no_tracebacks: | |||
relevant_frames = [] | |||
for i, frame in enumerate(err.traceback_lines): | |||
# Python2 tracebacks containing unicode need some special handling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see the minimum python version is now 3.8, so this make sense 👍
This removes code that was here for older versions of python that we no longer support. Unused imports have been removed while missing ones have been added.