Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion cafy_pytest/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ def pytest_addoption(parser):
group.addoption('--cafygta', dest='cafygta', action='store_true',
help='Variable to enable cafy gta, default is False')

group = parser.getgroup('Generate all.log.html - Enable/Disable')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit of a specific group for CLI args. Also, every added arg makes it harder for users to understand the help output - is this really necessary? Could it be added as an ini config option instead?

group.addoption('--all-log-html', dest='all_log_html', action='store_true',
help='Variable to enable all.log.html generation, default is False')


def is_valid_param(arg, file_type=None):
if not arg:
Expand Down Expand Up @@ -369,6 +373,7 @@ def pytest_configure(config):
CafyLog.mongomode=config.option.mongo_mode
CafyLog.giso_dir = config.option.giso_dir
script_list = config.option.file_or_dir
CafyLog.all_log_html = config.option.all_log_html
collection_list = []
log = None
for item in config.option.collection:
Expand Down Expand Up @@ -1972,7 +1977,8 @@ def collect_collection_report(self):
def pytest_terminal_summary(self, terminalreporter):
'''this hook is the execution point of email plugin'''
#self._generate_email_report(terminalreporter)
self._generate_all_log_html()
if CafyLog.all_log_html:
self._generate_all_log_html()
if self.CAFY_REPO:
option = terminalreporter.config.option
# self._create_archive(option)
Expand Down