Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
15 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
import os.path as osp | ||
import unittest | ||
|
||
TEST_FILES_DIR = osp.abspath(osp.join(osp.dirname(__file__), 'test_files')) | ||
TEST_BANK_DIR = osp.abspath(osp.join(osp.dirname(__file__), '..', '..', 'pylinac test files')) | ||
|
||
|
||
def run_tests(directory, pattern='test*.py'): | ||
# import a runner to run tests | ||
runner = unittest.TextTestRunner() | ||
# run test discovery | ||
test_suite = unittest.defaultTestLoader.discover(directory, pattern) | ||
# run test runner | ||
runner.run(test_suite) |
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,17 +1,7 @@ | ||
"""Test the entire package; an underscore precedes this file name | ||
so it does not include itself in the test discovery.""" | ||
import unittest | ||
import os.path as osp | ||
from . import run_tests | ||
|
||
|
||
def run(directory, pattern='test*.py'): | ||
# import a runner to run tests | ||
runner = unittest.TextTestRunner() | ||
# run test discovery | ||
test_suite = unittest.defaultTestLoader.discover(directory, pattern) | ||
# run test runner | ||
runner.run(test_suite) | ||
|
||
if __name__ == "__main__": | ||
test_dir = osp.dirname(__file__) | ||
run(test_dir) | ||
test_dir = osp.dirname(__file__) | ||
run_tests(test_dir) |
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