mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-17 03:17:35 +08:00
change: make converted referenced pytest files always relative to project RootDir
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import io
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
@@ -40,10 +41,12 @@ class TestCli(unittest.TestCase):
|
||||
self.assertIn(__description__, self.captured_output.getvalue().strip())
|
||||
|
||||
def test_debug_pytest(self):
|
||||
exit_code = pytest.main(
|
||||
[
|
||||
"-s",
|
||||
"examples/postman_echo/request_methods/request_with_testcase_reference_test.py",
|
||||
]
|
||||
)
|
||||
self.assertEqual(exit_code, 0)
|
||||
cwd = os.getcwd()
|
||||
try:
|
||||
os.chdir(os.path.join(cwd, "examples", "postman_echo"))
|
||||
exit_code = pytest.main(
|
||||
["-s", "request_methods/request_with_testcase_reference_test.py",]
|
||||
)
|
||||
self.assertEqual(exit_code, 0)
|
||||
finally:
|
||||
os.chdir(cwd)
|
||||
|
||||
Reference in New Issue
Block a user