X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ice_validator%2Ftests%2Fconftest.py;h=61f4cd8c5d49b75c0f82a62bd5daa27ad0a752c0;hb=ad5a66886c550eb6cb7c0d46bc097d382397fc87;hp=b165e39659035e9bda2e70d55d949c3c7fe76c1d;hpb=27299a14f4e0b70b495891314c6b6662a5b05ce5;p=vvp%2Fvalidation-scripts.git diff --git a/ice_validator/tests/conftest.py b/ice_validator/tests/conftest.py index b165e39..61f4cd8 100644 --- a/ice_validator/tests/conftest.py +++ b/ice_validator/tests/conftest.py @@ -432,12 +432,13 @@ def generate_report(outpath, template_path, categories, output_format="html"): failures = [r for r in ALL_RESULTS if r.is_failed] generate_failure_file(outpath) output_format = output_format.lower().strip() if output_format else "html" + generate_json(outpath, template_path, categories) if output_format == "html": generate_html_report(outpath, categories, template_path, failures) elif output_format == "excel": generate_excel_report(outpath, categories, template_path, failures) elif output_format == "json": - generate_json(outpath, template_path, categories) + return elif output_format == "csv": generate_csv_report(outpath, categories, template_path, failures) else: @@ -1061,9 +1062,9 @@ def build_rst_json(reqs): return data -def generate_rst_table(data): +def generate_rst_table(output_dir, data): """Generate a formatted csv to be used in RST""" - rst_path = os.path.join(__path__[0], "../output/rst.csv") + rst_path = os.path.join(output_dir, "rst.csv") with open(rst_path, "w", newline="") as f: out = csv.writer(f) out.writerow( @@ -1164,4 +1165,4 @@ def pytest_report_collectionfinish(config, startdir, items): test_name) ) - generate_rst_table(build_rst_json(json.dumps(reqs))) + generate_rst_table(get_output_dir(config), build_rst_json(json.dumps(reqs)))