mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-19 08:49:30 +08:00
feat: hrun supports run pytest files
This commit is contained in:
@@ -34,7 +34,7 @@ class TestHar(TestHar2CaseUtils):
|
||||
self.assertIn("validate", teststeps[0])
|
||||
|
||||
def test_gen_testcase_yaml(self):
|
||||
yaml_file = os.path.join(os.path.dirname(__file__), "data", "demo.yaml")
|
||||
yaml_file = os.path.join(os.path.dirname(__file__), "data", "demo.yml")
|
||||
|
||||
self.har_parser.gen_testcase(file_type="YAML")
|
||||
self.assertTrue(os.path.isfile(yaml_file))
|
||||
|
||||
@@ -6,10 +6,11 @@ from httprunner.make import (
|
||||
make_files_cache_set,
|
||||
make_config_chain_style,
|
||||
make_teststep_chain_style,
|
||||
pytest_files_set,
|
||||
)
|
||||
|
||||
|
||||
class TestLoader(unittest.TestCase):
|
||||
class TestMake(unittest.TestCase):
|
||||
def test_make_testcase(self):
|
||||
path = ["examples/postman_echo/request_methods/request_with_variables.yml"]
|
||||
testcase_python_list = main_make(path)
|
||||
@@ -23,6 +24,7 @@ class TestLoader(unittest.TestCase):
|
||||
"examples/postman_echo/request_methods/request_with_testcase_reference.yml"
|
||||
]
|
||||
make_files_cache_set.clear()
|
||||
pytest_files_set.clear()
|
||||
testcase_python_list = main_make(path)
|
||||
self.assertEqual(len(testcase_python_list), 1)
|
||||
self.assertIn(
|
||||
@@ -91,6 +93,7 @@ from examples.postman_echo.request_methods.request_with_functions_test import (
|
||||
def test_make_testsuite(self):
|
||||
path = ["examples/postman_echo/request_methods/demo_testsuite.yml"]
|
||||
make_files_cache_set.clear()
|
||||
pytest_files_set.clear()
|
||||
testcase_python_list = main_make(path)
|
||||
self.assertEqual(len(testcase_python_list), 2)
|
||||
self.assertIn(
|
||||
|
||||
Reference in New Issue
Block a user