mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-15 04:19:28 +08:00
change: testsuite pytest dirname
This commit is contained in:
@@ -134,7 +134,8 @@ def make_testsuite(testsuite: Dict) -> List[Text]:
|
||||
logger.info(f"start to make testsuite: {testsuite_path}")
|
||||
|
||||
# create directory with testsuite file name, put its testcases under this directory
|
||||
os.makedirs(os.path.dirname(os.path.splitext(testsuite_path)[0]), exist_ok=True)
|
||||
testsuite_dir = testsuite_path.replace(".", "_")
|
||||
os.makedirs(testsuite_dir, exist_ok=True)
|
||||
|
||||
testcase_files = []
|
||||
|
||||
@@ -145,7 +146,7 @@ def make_testsuite(testsuite: Dict) -> List[Text]:
|
||||
testcase_dict = load_test_file(testcase_path)
|
||||
testcase_dict.setdefault("config", {})
|
||||
testcase_dict["config"]["path"] = os.path.join(
|
||||
os.path.splitext(testsuite_path)[0], os.path.basename(testcase_path)
|
||||
testsuite_dir, os.path.basename(testcase_path)
|
||||
)
|
||||
|
||||
# override testcase name
|
||||
|
||||
@@ -59,10 +59,10 @@ class TestLoader(unittest.TestCase):
|
||||
testcase_python_list = main_make(path)
|
||||
self.assertEqual(len(testcase_python_list), 2)
|
||||
self.assertIn(
|
||||
"examples/postman_echo/request_methods/demo_testsuite/request_with_functions_test.py",
|
||||
"examples/postman_echo/request_methods/demo_testsuite_yml/request_with_functions_test.py",
|
||||
testcase_python_list,
|
||||
)
|
||||
self.assertIn(
|
||||
"examples/postman_echo/request_methods/demo_testsuite/request_with_testcase_reference_test.py",
|
||||
"examples/postman_echo/request_methods/demo_testsuite_yml/request_with_testcase_reference_test.py",
|
||||
testcase_python_list,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user