Bundle tests with applications

- For each application, add ./tests directory and __init__.py file
  within it.

- Modify test controllers (coverage.py, runtests.py) to find the new
  test directories for testing and coverage analysis.

- Move existing application-specific test modules (test_pagekite.py) to
  the newly created directories.
This commit is contained in:
Bob Girard 2015-06-22 17:24:30 -07:00 committed by Sunil Mohan Adapa
parent f91be5a4f9
commit d64ce6cc01
25 changed files with 11 additions and 3 deletions

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

@ -37,7 +37,10 @@ import time
SOURCE_DIRS = ['plinth'] + glob.glob('plinth/modules/*')
# Files to exclude from coverage analysis and reporting
FILES_TO_OMIT = ['plinth/tests/*.py']
FILES_TO_OMIT = [
'plinth/tests/*.py',
'plinth/modules/*/tests/*.py'
]
# Location of coverage HTML report files
COVERAGE_REPORT_DIR = 'plinth/tests/coverage/report'

View File

@ -37,9 +37,14 @@ def run_tests(pattern=None, return_to_caller=False):
test_runner = TestRunner()
if pattern is None:
pattern = 'plinth.tests'
pattern_list = [
'plinth/tests',
'plinth/modules'
]
else:
pattern_list = [pattern]
failures = test_runner.run_tests([pattern])
failures = test_runner.run_tests(pattern_list)
if failures > 0 or not return_to_caller:
sys.exit(bool(failures))