Skip to content

Commit 06bc213

Browse files
committed
Add S3 logging options to pytest config
1 parent 069123b commit 06bc213

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

conftest.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,22 @@ def pytest_addoption(parser):
4444
choices=('prod', 'qa', 'test'),
4545
default='test',
4646
help=SUPPRESS_HELP)
47+
parser.addoption('--with-s3_logging', action="store_true",
48+
dest='with_s3_logging',
49+
default=False,
50+
help="Use to save test log files in Amazon S3.")
51+
parser.addoption('--with-screen_shots', action="store_true",
52+
dest='with_screen_shots',
53+
default=False,
54+
help="Use to save screenshots on test failure.")
55+
parser.addoption('--with-basic_test_info', action="store_true",
56+
dest='with_basic_test_info',
57+
default=False,
58+
help="Use to save basic test info on test failure.")
59+
parser.addoption('--with-page_source', action="store_true",
60+
dest='with_page_source',
61+
default=False,
62+
help="Use to save page source on test failure.")
4763
parser.addoption('--headless', action="store_true",
4864
dest='headless',
4965
default=False,
@@ -64,6 +80,10 @@ def pytest_configure(config):
6480
with_selenium = config.getoption('with_selenium')
6581
with_testing_base = config.getoption('with_testing_base')
6682
with_db_reporting = config.getoption('with_db_reporting')
83+
with_s3_logging = config.getoption('with_s3_logging')
84+
with_screen_shots = config.getoption('with_screen_shots')
85+
with_basic_test_info = config.getoption('with_basic_test_info')
86+
with_page_source = config.getoption('with_page_source')
6787
database_env = config.getoption('database_env')
6888
browser = config.getoption('browser')
6989
log_path = config.getoption('log_path')
@@ -85,6 +105,10 @@ def pytest_configure(config):
85105
config_file.write("data:::%s\n" % data)
86106
config_file.write("with_testing_base:::%s\n" % with_testing_base)
87107
config_file.write("with_db_reporting:::%s\n" % with_db_reporting)
108+
config_file.write("with_s3_logging:::%s\n" % with_s3_logging)
109+
config_file.write("with_screen_shots:::%s\n" % with_screen_shots)
110+
config_file.write("with_basic_test_info:::%s\n" % with_basic_test_info)
111+
config_file.write("with_page_source:::%s\n" % with_page_source)
88112
config_file.write("database_env:::%s\n" % database_env)
89113
config_file.write("log_path:::%s\n" % log_path)
90114
config_file.write("headless:::%s\n" % headless)

0 commit comments

Comments
 (0)