create pytest arguments dynamically
This commit is contained in:
parent
d6f90b1d64
commit
32d61cd297
1 changed files with 33 additions and 13 deletions
|
|
@ -45,19 +45,39 @@ class Runner:
|
||||||
will run all tests in the file at full_test_path with some command line arguments"""
|
will run all tests in the file at full_test_path with some command line arguments"""
|
||||||
|
|
||||||
ic(f"running test: {full_test_path}")
|
ic(f"running test: {full_test_path}")
|
||||||
pytest.main(
|
|
||||||
[
|
command_arguments = []
|
||||||
"-v",
|
|
||||||
"-rp",
|
command_arguments.append("-v")
|
||||||
str(full_test_path),
|
command_arguments.append("-rp")
|
||||||
"--env_file",
|
command_arguments.append(str(full_test_path))
|
||||||
str(self.dotenv_path),
|
|
||||||
"--tests_dir",
|
command_arguments.append("--env_file")
|
||||||
str(self.tests_dir),
|
command_arguments.append(str(self.dotenv_path))
|
||||||
"--session_id",
|
|
||||||
self.session_id,
|
command_arguments.append("--tests_dir")
|
||||||
]
|
command_arguments.append(str(self.tests_dir))
|
||||||
)
|
|
||||||
|
command_arguments.append("--session_id")
|
||||||
|
command_arguments.append(self.session_id)
|
||||||
|
|
||||||
|
# artifacts dir
|
||||||
|
output = self.dir_manager.RESULTS / full_test_path.stem
|
||||||
|
command_arguments.append("--output")
|
||||||
|
command_arguments.append(str(output))
|
||||||
|
|
||||||
|
# tracing
|
||||||
|
command_arguments.append("--tracing")
|
||||||
|
command_arguments.append("on")
|
||||||
|
|
||||||
|
# disable capturing
|
||||||
|
# pytest -s # disable all capturing
|
||||||
|
command_arguments.append("-s")
|
||||||
|
|
||||||
|
# headed
|
||||||
|
command_arguments.append("--headed")
|
||||||
|
|
||||||
|
pytest.main(command_arguments)
|
||||||
|
|
||||||
def show_files(self):
|
def show_files(self):
|
||||||
ic(list(self.root_dir.glob("*")))
|
ic(list(self.root_dir.glob("*")))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue