support/run-tests: reorder imports
PATCH 1/2 support/run-tests: reorder imports
From: Yegor Yefremov <[email protected]>
Reorder imports using the isort utility.
--- support/testing/run-tests | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
support/testing/run-tests +3 -2
@@ -1,9 +1,10 @@ #!/usr/bin/env python3 import argparse -import sys +import multiprocessing import os +import sys + import nose2 -import multiprocessing from infra.basetest import BRConfigTest
Signature · 1 line
2.17.0
PATCH 2/2 support/run-tests: check for empty sequences in a pythonic way
From: Yegor Yefremov <[email protected]>
According to PEP8 empty sequences should be checked as booleans.
Fixes the following PEP8 warning:
Do not use len(SEQUENCE) to determine if a sequence is empty
--- support/testing/run-tests | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
support/testing/run-tests +2 -2
@@ -71,7 +71,7 @@ def main(): BRConfigTest.outputdir = os.path.abspath(args.output) - if args.all is False and len(args.testname) == 0: + if args.all is False and not args.testname: print("No test selected") print("") parser.print_help()
@@ -113,7 +113,7 @@ def main(): "-s", test_dir, "-c", os.path.join(test_dir, "conf/unittest.cfg")] - if len(args.testname) != 0: + if args.testname: nose2_args += args.testname nose2.discover(argv=nose2_args)
Signature · 1 line
2.17.0
PATCH 2/2 support/run-tests: check for empty sequences in a pythonic way
Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"yegorslists" == yegorslists <[email protected]> writes:
From: Yegor Yefremov <[email protected]> According to PEP8 empty sequences should be checked as booleans.
Fixes the following PEP8 warning:
Do not uselen(SEQUENCE)to determine if a sequence is emptySigned-off-by Yegor Yefremov <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 1/2 support/run-tests: reorder imports
In reply to yegorslists at googlemail.comQuoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"yegorslists" == yegorslists <[email protected]> writes:
From: Yegor Yefremov <[email protected]>
Reorder imports using the isort utility.
Why? Does the current order cause any issues or warnings from linters?
Signature · 1 line
Bye, Peter Korsgaard
PATCH 1/2 support/run-tests: reorder imports
Hi Peter,
Quoted 7 lines · Peter Korsgaard
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
"yegorslists" == yegorslists <[email protected]> writes:
From: Yegor Yefremov <[email protected]>
Reorder imports using the isort utility.Why? Does the current order cause any issues or warnings from linters?
I get this warning:
wrong-import-order: standard import "import multiprocessing" should be placed before "import nose2"
Yegor
PATCH 1/2 support/run-tests: reorder imports
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Yegor" == Yegor Yefremov <[email protected]> writes:
Hi Peter,
Quoted 6 lines · Peter Korsgaard
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
"yegorslists" == yegorslists <[email protected]> writes:
From: Yegor Yefremov <[email protected]>
Reorder imports using the isort utility.
Quoted 6 lines
Quoted 1 line
Why? Does the current order cause any issues or warnings from linters?
I get this warning:
wrong-import-order: standard import "import multiprocessing" should be placed before "import nose2"
Ok, From what checker do you get this warning?
Signature · 1 line
Bye, Peter Korsgaard
PATCH 1/2 support/run-tests: reorder imports
Quoted 11 lines · Peter Korsgaard
Quoted 11 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
"Yegor" == Yegor Yefremov <[email protected]> writes:
Hi Peter,
Quoted 6 lines · Peter Korsgaard
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
"yegorslists" == yegorslists <[email protected]> writes:
From: Yegor Yefremov <[email protected]>
Reorder imports using the isort utility.
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Why? Does the current order cause any issues or warnings from linters?
I get this warning:
wrong-import-order: standard import "import multiprocessing" should be placed before "import nose2"
Ok, From what checker do you get this warning?
pylint3 support/testing/run-tests
No config file found, using default configuration ************* Module run-tests
C: 1, 0: Module name "run-tests" doesn't conform to snake_case naming style (invalid-name)
C: 1, 0: Missing module docstring (missing-docstring)
C: 11, 0: Missing function docstring (missing-docstring)
C: 73,29: Do not use len(SEQUENCE) to determine if a sequence is empty (len-as-condition)
C:115, 7: Do not use len(SEQUENCE) to determine if a sequence is empty (len-as-condition)
R: 11, 0: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
R: 11, 0: Too many return statements (7/6) (too-many-return-statements)
R: 11, 0: Too many branches (14/12) (too-many-branches)
R: 11, 0: Too many statements (64/50) (too-many-statements)
C: 6, 0: standard import "import multiprocessing" should be placed before "import nose2" (wrong-import-order)
------------------------------------------------------------------
Your code has been rated at 8.73/10 (previous run: 8.73/10, +0.00)
PATCH 1/2 support/run-tests: reorder imports
Quoted 16 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Yegor" == Yegor Yefremov <[email protected]> writes:
Quoted 13 lines · Peter Korsgaard
Quoted 12 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
"Yegor" == Yegor Yefremov <[email protected]> writes:
Hi Peter,
Quoted 7 lines · Peter Korsgaard
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
"yegorslists" == yegorslists <[email protected]> writes:
From: Yegor Yefremov <[email protected]>
Reorder imports using the isort utility.Why? Does the current order cause any issues or warnings from linters?
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
I get this warning:
wrong-import-order: standard import "import multiprocessing" should be placed before "import nose2"
Ok, From what checker do you get this warning?
pylint3 support/testing/run-tests
Ok, committed with that added to the commit message, thanks.
Signature · 1 line
Bye, Peter Korsgaard