commit 7c6f4d9731195d9fb8e49bc8943d63dc063e8c65 Author: Damian Johnson atagar@torproject.org Date: Wed Jan 1 18:03:33 2014 -0800
Always running style checks
Running pep8 took substantially longer than all our unit tests, so we only ran it if the user included the '--style' argument. Now that the runtime's down to something reasonable we can include it in all test runs. --- docs/faq.rst | 6 +----- run_tests.py | 11 +++-------- test/settings.cfg | 1 + 3 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/docs/faq.rst b/docs/faq.rst index 2c35399..984ab54 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -451,11 +451,7 @@ Stem has three kinds of tests: **unit**, **integration**, and **static**. ~/stem$ ./run_tests.py --integ --tor /path/to/tor ~/stem$ ./run_tests.py --integ --target RUN_COOKIE
-**Static** tests use `pyflakes https://launchpad.net/pyflakes`_ to do static error checking and `pep8 http://pep8.readthedocs.org/en/latest/`_ for style checking. If you have them installed then pyflakes automatically takes place as part of all test runs, but style checking is run separately... - -:: - - ~/stem$ ./run_tests.py --style +**Static** tests use `pyflakes https://launchpad.net/pyflakes`_ to do static error checking and `pep8 http://pep8.readthedocs.org/en/latest/`_ for style checking. If you have them installed then they automatically take place as part of all test runs.
If you have **python 3** installed then you can test our python 3 compatibility with the following. *Note that need to still initially execute run_tests.py with a 2.x version of python.*
diff --git a/run_tests.py b/run_tests.py index 5f65fd4..0d0e6d0 100755 --- a/run_tests.py +++ b/run_tests.py @@ -43,7 +43,6 @@ from test.util import STEM_BASE, Target, Task ARGS = { 'run_unit': False, 'run_integ': False, - 'run_style': False, 'run_python3': False, 'run_python3_clean': False, 'test_prefix': None, @@ -54,8 +53,8 @@ ARGS = { 'print_help': False, }
-OPT = "auist:l:h" -OPT_EXPANDED = ["all", "unit", "integ", "style", "python3", "clean", "targets=", "test=", "log=", "tor=", "help"] +OPT = "auit:l:h" +OPT_EXPANDED = ["all", "unit", "integ", "python3", "clean", "targets=", "test=", "log=", "tor=", "help"]
CONFIG = stem.util.conf.config_dict("test", { "target.torrc": {}, @@ -113,7 +112,7 @@ def main(): if args.print_help: println(test.util.get_help_message()) sys.exit() - elif not args.run_unit and not args.run_integ and not args.run_style: + elif not args.run_unit and not args.run_integ: println("Nothing to run (for usage provide --help)\n") sys.exit()
@@ -300,13 +299,10 @@ def _get_args(argv): if opt in ("-a", "--all"): args['run_unit'] = True args['run_integ'] = True - args['run_style'] = True elif opt in ("-u", "--unit"): args['run_unit'] = True elif opt in ("-i", "--integ"): args['run_integ'] = True - elif opt in ("-s", "--style"): - args['run_style'] = True elif opt == "--python3": args['run_python3'] = True elif opt == "--clean": @@ -371,7 +367,6 @@ def _print_static_issues(args): else: println("Static error checking requires pyflakes. Please install it from ...\n http://pypi.python.org/pypi/pyflakes%5Cn", ERROR)
- if args.run_style: if test.util.is_pep8_available(): static_check_issues.update(test.util.get_stylistic_issues(SRC_PATHS)) else: diff --git a/test/settings.cfg b/test/settings.cfg index 311d02e..bb68a3b 100644 --- a/test/settings.cfg +++ b/test/settings.cfg @@ -143,6 +143,7 @@ pyflakes.ignore test/mocking.py => undefined name 'builtins' pyflakes.ignore test/mocking.py => undefined name 'test' pyflakes.ignore test/unit/response/events.py => 'from stem import *' used; unable to detect undefined names pyflakes.ignore test/util.py => 'pyflakes' imported but unused +pyflakes.ignore test/util.py => 'pep8' imported but unused
# Test modules we want to run. Modules are roughly ordered by the dependencies # so the lowest level tests come first. This is because a problem in say,
tor-commits@lists.torproject.org