diff --git a/tests/e2e/interOp/conftest.py b/tests/e2e/interOp/conftest.py index ae614f904..4453cecd5 100644 --- a/tests/e2e/interOp/conftest.py +++ b/tests/e2e/interOp/conftest.py @@ -692,32 +692,32 @@ def pytest_runtest_makereport(item, call): def pytest_sessionfinish(session, exitstatus): + if reporting_client is not None: + print() + skipped_amount = 0 + # print('Perfecto TestCase Execution Status:', exitstatus) + passed_amount = sum(1 for result in session.results.values() if result.passed) + failed_amount = sum(1 for result in session.results.values() if result.failed) + skipped_amount = sum(1 for result in session.results.values() if result.skipped) + # print(f'There are {passed_amount} passed and {failed_amount} failed tests') + TotalExecutedCount = failed_amount + passed_amount + skipped_amount - print() - skipped_amount = 0 - #print('Perfecto TestCase Execution Status:', exitstatus) - passed_amount = sum(1 for result in session.results.values() if result.passed) - failed_amount = sum(1 for result in session.results.values() if result.failed) - skipped_amount = sum(1 for result in session.results.values() if result.skipped) - # print(f'There are {passed_amount} passed and {failed_amount} failed tests') - TotalExecutedCount = failed_amount + passed_amount + skipped_amount - - print('\n------------------------------------') - print('Interop Perfecto TestCase Execution Summary') - print('------------------------------------') - print('Total TestCase Executed: ' + str(TotalExecutedCount)) - print('Total Passed: ' + str(passed_amount)) - print('Total Failed: ' + str(failed_amount)) - print('Total Skipped: ' + str(skipped_amount) + "\n") - - try: - for index in range(len(testCaseNameList)): - print(str(index+1) + ") " + str(testCaseNameList[index]) + " : " + str(testCaseStatusList[index])) - print(" ReportURL: " + str(testCaseReportURL[index])) - print(" FailureMsg: " + str(testCaseErrorMsg[index]) + "\n") - except Exception as e: - print('No Interop Test Cases Executed') - + print('\n------------------------------------') + print('TestCase Execution Summary') + print('------------------------------------') + print('Total TestCase Executed: ' + str(TotalExecutedCount)) + print('Total Passed: ' + str(passed_amount)) + print('Total Failed: ' + str(failed_amount)) + print('Total Skipped: ' + str(skipped_amount) + "\n") + try: + for index in range(len(testCaseNameList)): + print(str(index + 1) + ") " + str(testCaseNameList[index]) + " : " + str(testCaseStatusList[index])) + print(" ReportURL: " + str(testCaseReportURL[index])) + print(" FailureMsg: " + str(testCaseErrorMsg[index]) + "\n") + except Exception as e: + print('No Interop Test Cases Executed') + else: + pass print('------------------------------------------------------------------\n\n\n\n') @pytest.fixture(scope="function")