diff --git a/run_tests.py b/run_tests.py index 8cb0485c97340bd0dfb366d9254ae78e7262fce7..fcd27d1bcd09734ad67f9fda54e81752d3f8d069 100644 --- a/run_tests.py +++ b/run_tests.py @@ -13,18 +13,18 @@ time.sleep(2) sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), 'lib'))) sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), 'src'))) - -print("Run") -runner = unittest.TextTestRunner().run(unittest.defaultTestLoader.discover(start_dir='cutecoin.tests', pattern='test_*')) -print("Terminate") -os.kill(p.pid, signal.SIGINT) -time.sleep(2) - try: - os.kill(p.pid, signal.SIGKILL) - p.kill() - print("Hard killed") -except OSError: - print("Terminated gracefully") + print("Run") + runner = unittest.TextTestRunner().run(unittest.defaultTestLoader.discover(start_dir='cutecoin.tests', pattern='test_*')) +finally: + print("Terminate") + os.kill(p.pid, signal.SIGINT) + time.sleep(2) + try: + os.kill(p.pid, signal.SIGKILL) + p.kill() + print("Hard killed") + except OSError: + print("Terminated gracefully") sys.exit(not runner.wasSuccessful()) \ No newline at end of file diff --git a/src/cutecoin/tests/process_cfg_community/test_add_community.py b/src/cutecoin/tests/process_cfg_community/test_add_community.py index 97a83f98ff1677a9afeaa0ca6015da30b3079f58..2fe1b1c43cfe7a9a1ca27480991e3f939c490cea 100644 --- a/src/cutecoin/tests/process_cfg_community/test_add_community.py +++ b/src/cutecoin/tests/process_cfg_community/test_add_community.py @@ -62,7 +62,7 @@ class ProcessAddCommunity(unittest.TestCase): process_community.spinbox_port.setValue(50000) self.assertEqual(process_community.stacked_pages.currentWidget(), process_community.page_node, - msg="Current widget : {0}".format(process_community.stacked_pages.currentWidget().name())) + msg="Current widget : {0}".format(process_community.stacked_pages.currentWidget().objectName())) self.assertEqual(process_community.lineedit_server.text(), "127.0.0.1") self.assertEqual(process_community.spinbox_port.value(), 50000) QTest.mouseClick(process_community.button_register, Qt.LeftButton) @@ -84,7 +84,7 @@ class ProcessAddCommunity(unittest.TestCase): self.assertEqual(process_community.stacked_pages.currentWidget(), process_community.page_add_nodes, - msg="Current widget : {0}".format(process_community.stacked_pages.currentWidget().name())) + msg="Current widget : {0}".format(process_community.stacked_pages.currentWidget().objectName())) QTest.mouseClick(process_community.button_next, Qt.LeftButton) asyncio.async(exec_test())