diff --git a/scripts/tests/chiptest/yamltest_with_chip_repl_tester.py b/scripts/tests/chiptest/yamltest_with_chip_repl_tester.py index ccd026438d6f39..1b301c572874d0 100644 --- a/scripts/tests/chiptest/yamltest_with_chip_repl_tester.py +++ b/scripts/tests/chiptest/yamltest_with_chip_repl_tester.py @@ -153,6 +153,4 @@ def _StackShutDown(): if __name__ == '__main__': - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) - loop.close() + asyncio.run(main()) diff --git a/src/controller/python/test/test_scripts/commissioning_failure_test.py b/src/controller/python/test/test_scripts/commissioning_failure_test.py index 56a7fe8e1840d7..f082ae99628af3 100755 --- a/src/controller/python/test/test_scripts/commissioning_failure_test.py +++ b/src/controller/python/test/test_scripts/commissioning_failure_test.py @@ -136,9 +136,7 @@ async def main(): if __name__ == "__main__": try: - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) - loop.close() + asyncio.run(main()) except Exception as ex: logger.exception(ex) TestFail("Exception occurred when running tests.") diff --git a/src/controller/python/test/test_scripts/commissioning_test.py b/src/controller/python/test/test_scripts/commissioning_test.py index 89b7685720260f..c53ab00f33489a 100755 --- a/src/controller/python/test/test_scripts/commissioning_test.py +++ b/src/controller/python/test/test_scripts/commissioning_test.py @@ -164,9 +164,7 @@ async def main(): if __name__ == "__main__": try: - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) - loop.close() + asyncio.run(main()) except Exception as ex: logger.exception(ex) TestFail("Exception occurred when running tests.") diff --git a/src/controller/python/test/test_scripts/failsafe_tests.py b/src/controller/python/test/test_scripts/failsafe_tests.py index 1a33cad75bd92d..d27111cbf76354 100755 --- a/src/controller/python/test/test_scripts/failsafe_tests.py +++ b/src/controller/python/test/test_scripts/failsafe_tests.py @@ -113,9 +113,7 @@ async def main(): if __name__ == "__main__": try: - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) - loop.close() + asyncio.run(main()) except Exception as ex: logger.exception(ex) TestFail("Exception occurred when running tests.") diff --git a/src/controller/python/test/test_scripts/split_commissioning_test.py b/src/controller/python/test/test_scripts/split_commissioning_test.py index ad00b9d8397679..864a6f357dd434 100755 --- a/src/controller/python/test/test_scripts/split_commissioning_test.py +++ b/src/controller/python/test/test_scripts/split_commissioning_test.py @@ -137,9 +137,7 @@ async def main(): if __name__ == "__main__": try: - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) - loop.close() + asyncio.run(main()) except Exception as ex: logger.exception(ex) TestFail("Exception occurred when running tests.") diff --git a/src/controller/python/test/test_scripts/subscription_resumption_capacity_test_ctrl1.py b/src/controller/python/test/test_scripts/subscription_resumption_capacity_test_ctrl1.py index 092940a2cddcf6..dc126a1d0400c4 100755 --- a/src/controller/python/test/test_scripts/subscription_resumption_capacity_test_ctrl1.py +++ b/src/controller/python/test/test_scripts/subscription_resumption_capacity_test_ctrl1.py @@ -129,9 +129,7 @@ async def main(): if __name__ == "__main__": try: - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) - loop.close() + asyncio.run(main()) except Exception as ex: logger.exception(ex) TestFail("Exception occurred when running tests.") diff --git a/src/controller/python/test/test_scripts/subscription_resumption_capacity_test_ctrl2.py b/src/controller/python/test/test_scripts/subscription_resumption_capacity_test_ctrl2.py index 6c6c2bfce648fb..2f50e80bf2fa75 100755 --- a/src/controller/python/test/test_scripts/subscription_resumption_capacity_test_ctrl2.py +++ b/src/controller/python/test/test_scripts/subscription_resumption_capacity_test_ctrl2.py @@ -141,9 +141,7 @@ async def main(): if __name__ == "__main__": try: - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) - loop.close() + asyncio.run(main()) except Exception as ex: logger.exception(ex) TestFail("Exception occurred when running tests.") diff --git a/src/controller/python/test/test_scripts/subscription_resumption_test.py b/src/controller/python/test/test_scripts/subscription_resumption_test.py index 790d2b59c08dd2..b7420c8c17ee73 100755 --- a/src/controller/python/test/test_scripts/subscription_resumption_test.py +++ b/src/controller/python/test/test_scripts/subscription_resumption_test.py @@ -130,9 +130,7 @@ async def main(): if __name__ == "__main__": try: - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) - loop.close() + asyncio.run(main()) except Exception as ex: logger.exception(ex) TestFail("Exception occurred when running tests.") diff --git a/src/controller/python/test/test_scripts/subscription_resumption_timeout_test.py b/src/controller/python/test/test_scripts/subscription_resumption_timeout_test.py index e31f5d350f72f1..f4809a28a8e7a8 100755 --- a/src/controller/python/test/test_scripts/subscription_resumption_timeout_test.py +++ b/src/controller/python/test/test_scripts/subscription_resumption_timeout_test.py @@ -123,9 +123,7 @@ async def main(): if __name__ == "__main__": try: - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) - loop.close() + asyncio.run(main()) except Exception as ex: logger.exception(ex) TestFail("Exception occurred when running tests.")