from kdoc.xforms_lists import CTransforms
-from unittest_helper import run_unittest
+from unittest_helper import TestUnits
#
#
TEST_FILE = os.path.join(SRC_DIR, "kdoc-test.yaml")
+env = {
+ "yaml_file": TEST_FILE
+}
+
#
# Ancillary logic to clean whitespaces
#
optional ones.
"""
- with open(TEST_FILE, encoding="utf-8") as fp:
+ test_file = os.environ.get("yaml_file", TEST_FILE)
+
+ with open(test_file, encoding="utf-8") as fp:
testset = yaml.safe_load(fp)
tests = testset["tests"]
# Run all tests
#
if __name__ == "__main__":
- run_unittest(__file__)
+ runner = TestUnits()
+ parser = runner.parse_args()
+ parser.add_argument("-y", "--yaml-file", "--yaml",
+ help='Name of the yaml file to load')
+
+ args = parser.parse_args()
+
+ if args.yaml_file:
+ env["yaml_file"] = os.path.expanduser(args.yaml_file)
+
+ # Run tests with customized arguments
+ runner.run(__file__, parser=parser, args=args, env=env)