-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed pylint warning from code similarities in tests
The test code contain setup and teardown that are same for two tests. Pylint complains about these two methods in two modules. The setup and teardown are needed because they are called by the test framework and cannot be removed. It seems that pylint 1.7.2 has open fault that makes disabling of the check in portion of the code not to work /1/. It also seems that pylint 1.7.2 the ignore-comments and ignore-docstrings do not seem to work as expected. Even when the values should state that these are ignored, the min-similarity had to be increased to 8 because there are 7 lines in these two referred methods. The target is to get the warnings down to see changes easily. This fix could be fixed later on by setting the min-similarity to 4 and use the ignore docstring and comment settings combined with the code tag to ignore the duplicated code. /1/ pylint-dev/pylint#214 Signed-off-by: Heikki Laaksonen <[email protected]>
- Loading branch information
Showing
4 changed files
with
5 additions
and
20 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
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 |
---|---|---|
@@ -1,21 +1,4 @@ | ||
************* Module tests.testlib.argument_helper | ||
R: 1, 0: Similar lines in 2 files | ||
==tests.test_arguments_add_new_snippet:181 | ||
==tests.test_config_add_new_snippet:223 | ||
@classmethod | ||
def setup_class(cls): | ||
"""Test class setup before any of the tests are run.""" | ||
|
||
print('setup_class()') | ||
ArgumentHelper().reset() | ||
|
||
@classmethod | ||
def teardown_class(cls): | ||
"""Test class teardown after all tests run.""" | ||
|
||
print('teardown_class()') | ||
ArgumentHelper().reset() (duplicate-code) | ||
|
||
------------------------------------------------------------------ | ||
Your code has been rated at 9.97/10 (previous run: 9.97/10, +0.00) | ||
------------------------------------------------------------------- | ||
Your code has been rated at 10.00/10 (previous run: 9.97/10, +0.03) | ||
|
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
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