Hello!
Already asked this question in one forum, but did not receive an answer. Duplicate here with all the results.
Essence of the question:
There is a jenkins that runs tests (python + wd). In the script body itself, there is a function for downloading HTMLTestRunner reports.
Jenkins does not show Finished: SUCCESS , despite the fact that the test itself fell. This happens because C: \ Program Files (x86) \ Jenkins \ jobs \ Џа®ўҐаЄ "ЁзЁп ¬®¤" mle ®Є® \ workspace> exit 0 .
I suspect that this behavior can be caused by the fact that the last f-th is just HTMLTestRunner, and it is constantly regardless of the results that f-th above writes the report successfully, so jenkins believes him and does not fall. Tell me how to get rid of it? I attach the code:
class ASeleniumLogin_1(unittest.TestCase): def test_001_LoginInSYSDev(self): assert "Login" in driver.title _ = wait.until(EC.element_to_be_clickable((By.ID, 'LoginForm_username'))) elem = driver.find_element_by_id("LoginForm_username1") # НИКОГДА НЕ НАЙДЕТ ЭТОТ ЭЛЕМЕНТ, СДЕЛАНО ДЛЯ ВЫЗОВА ОШИБКИ elem.send_keys("user") elem = driver.find_element_by_id("LoginForm_password") elem.send_keys("pass") elem.send_keys(Keys.RETURN) print('\n 1. Логинимся в систему') wait.until(EC.element_to_be_clickable((By.CLASS_NAME, 'hidden-xs'))) if __name__ == '__main__': suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(ASeleniumLogin_1)) buf = open("at_for_MATERIAL.html", 'wb') runner = HTMLTestRunner.HTMLTestRunner( stream=buf, title='Отчет по тестированию', description='Отчет по тестированию' ) runner.run(suite) I also found this topic: https://stackoverflow.com/
In it, a person encountered a similar problem. I will ask a stupid question, if what is described there is really true in my case, then where should EXIT XX be used in the assembly team itself in jenkins or in the script code? Thanks in advance for your reply (s)

import sys .. if __name__ == '__main__': suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(ASeleniumLogin_1)) # File buf = open("at_for_QUESTIONS_AND_PRIORITY.html", 'wb') runner = HTMLTestRunner.HTMLTestRunner( stream=buf, title='СОЗДАНИЕ И УДАЛЕНИЕ ПРИОРИТЕТА', description='Отчет по тестированию' ) ret = not runner.run(suite).wasSuccessful() sys.exit(ret)following construction:import sys .. if __name__ == '__main__': suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(ASeleniumLogin_1)) # File buf = open("at_for_QUESTIONS_AND_PRIORITY.html", 'wb') runner = HTMLTestRunner.HTMLTestRunner( stream=buf, title='СОЗДАНИЕ И УДАЛЕНИЕ ПРИОРИТЕТА', description='Отчет по тестированию' ) ret = not runner.run(suite).wasSuccessful() sys.exit(ret)like, it worked , but we still need to test - blindeStern