1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
From: Jochen Sprickerhof <git@jochen.sprickerhof.de>
Date: Sat, 18 Nov 2023 21:04:02 +0100
Subject: Add assert_ to RosTest
This was removed in Python 3.12:
https://docs.python.org/3/whatsnew/3.12.html#unittest-testcase-removed-aliases
---
tools/rostest/src/rostest/runner.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/rostest/src/rostest/runner.py b/tools/rostest/src/rostest/runner.py
index 8159faa..d853d17 100644
--- a/tools/rostest/src/rostest/runner.py
+++ b/tools/rostest/src/rostest/runner.py
@@ -231,7 +231,7 @@ def createUnitTest(pkg, test_file, reuse_master=False, clear=False, results_base
# pass in config to class as a property so that test_parent can be initialized
classdict = { 'setUp': setUp, 'tearDown': tearDown, 'config': config,
'test_parent': None, 'test_file': test_file,
- 'reuse_master': reuse_master, 'clear': clear }
+ 'reuse_master': reuse_master, 'clear': clear, 'assert_': unittest.TestCase.assertTrue }
# add in the tests
testNames = []
|