Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.11 compatibility with unittest methods #145

Open
tirkarthi opened this issue Dec 26, 2021 · 1 comment
Open

Python 3.11 compatibility with unittest methods #145

tirkarthi opened this issue Dec 26, 2021 · 1 comment

Comments

@tirkarthi
Copy link

The deprecated unittest aliases were removed in python/cpython#28268 . The following replacements can be made for Python 3.11 compatibility.

assertEquals -> assertEqual
failIf -> assertFalse

test/test_genpy_rostime.py:        self.assertEquals(0, v.secs)
test/test_genpy_rostime.py:        self.assertEquals(0, v.nsecs)
test/test_genpy_rostime.py:        self.failIf(v) # test __zero__
test/test_genpy_rostime.py:        self.assertEquals('0', str(v))
test/test_genpy_rostime.py:        self.assertEquals(0, v.to_nsec())
test/test_genpy_rostime.py:        self.assertEquals(0, v.to_sec())
test/test_genpy_rostime.py:        self.assertEquals(v, v)
test/test_genpy_rostime.py:        self.assertEquals(v, TVal())
test/test_genpy_rostime.py:        self.assertEquals(v, TVal(0))
test/test_genpy_rostime.py:        self.assertEquals(v, TVal(0, 0))
test/test_genpy_rostime.py:        self.assertEquals(v.__hash__(), TVal(0, 0).__hash__())
test/test_genpy_rostime.py:        self.assertEquals(0, v.secs)
test/test_genpy_rostime.py:        self.assertEquals(0, v.nsecs)
test/test_genpy_rostime.py:        self.assertEquals(1, v.secs)
test/test_genpy_rostime.py:        self.assertEquals(0, v.nsecs)
test/test_genpy_rostime.py:        self.assertEquals(0, v.secs)
test/test_genpy_rostime.py:        self.assertEquals(1, v.nsecs)
test/test_genpy_rostime.py:        self.assertEquals(0, v.secs)
test/test_genpy_rostime.py:        self.assertEquals(1000000000, v.nsecs)
test/test_genpy_rostime.py:        self.assertEquals(1, v.secs)
test/test_genpy_rostime.py:        self.assertEquals(0, v.nsecs)
test/test_genpy_rostime.py:        self.assertEquals(1, v.secs)
test/test_genpy_rostime.py:        self.assertEquals(0, v.nsecs)
test/test_genpy_rostime.py:        self.failIf(v.is_zero())
test/test_genpy_rostime.py:        self.assertEquals('1000000000', str(v))
test/test_genpy_rostime.py:        self.assertEquals(1000000000, v.to_nsec())
test/test_genpy_rostime.py:        self.assertEquals(v, v)
test/test_genpy_rostime.py:        self.assertEquals(v, TVal(1))
test/test_genpy_rostime.py:        self.assertEquals(v, TVal(1, 0))
test/test_genpy_rostime.py:        self.assertEquals(v, TVal(0,1000000000))
test/test_genpy_rostime.py:        self.assertEquals(v.__hash__(), TVal(0,1000000000).__hash__())
test/test_genpy_rostime.py:        self.assertNotEquals(v, TVal(0, 0))
test/test_genpy_rostime.py:        self.assertNotEquals(v.__hash__(), TVal(0, 0).__hash__())
test/test_genpy_rostime.py:        self.assertEquals(NotImplemented, v.__ge__(0))
test/test_genpy_rostime.py:        self.assertEquals(NotImplemented, v.__gt__(Foo()))
test/test_genpy_rostime.py:        self.assertEquals(NotImplemented, v.__ge__(Foo()))
test/test_genpy_rostime.py:        self.assertEquals(NotImplemented, v.__le__(Foo()))
test/test_genpy_rostime.py:        self.assertEquals(NotImplemented, v.__lt__(Foo()))
test/test_genpy_rostime.py:        self.failIf(v.__eq__(Foo()))
test/test_genpy_rostime.py:        self.assertEquals(0, v.secs)
test/test_genpy_rostime.py:        self.assertEquals(1, v.nsecs)
test/test_genpy_rostime.py:        self.failIf(v.is_zero())
test/test_genpy_rostime.py:        self.assertEquals('1', str(v))
test/test_genpy_rostime.py:        self.assertEquals(1, v.to_nsec())
test/test_genpy_rostime.py:        self.assertEquals(v, v)
test/test_genpy_rostime.py:        self.assertEquals(v, TVal(0,1))
test/test_genpy_rostime.py:        self.assertNotEquals(v, TVal(0, 0))
test/test_genpy_rostime.py:        self.assertEquals(2, v.secs)
test/test_genpy_rostime.py:        self.assertEquals(0, v.nsecs)
test/test_genpy_rostime.py:        self.assertEquals(2, v.to_sec())
test/test_genpy_rostime.py:        self.assertEquals(2000000000, v.to_nsec())
test/test_genpy_rostime.py:        self.assertEquals(2, v.secs)
test/test_genpy_rostime.py:        self.assertEquals(1, v.nsecs)
test/test_genpy_rostime.py:        self.assertEquals(2.000000001, v.to_sec())
test/test_genpy_rostime.py:        self.assertEquals(2000000001, v.to_nsec())
test/test_genpy_rostime.py:        self.assertEquals(0, v.secs)
test/test_genpy_rostime.py:        self.assertEquals(0, v.nsecs)
test/test_genpy_rostime.py:        self.assertEquals(0, v.secs)
test/test_genpy_rostime.py:        self.assertEquals(1, v.nsecs)
test/test_genpy_rostime.py:        self.assertEquals(0.000000001, v.to_sec())
test/test_genpy_rostime.py:        self.assertEquals(1, v.to_nsec())
test/test_genpy_rostime.py:            self.assertEquals(-2, v.secs)
test/test_genpy_rostime.py:            self.assertEquals(0, v.nsecs)
test/test_genpy_rostime.py:            self.assertEquals(-2, v.to_sec())
test/test_genpy_rostime.py:            self.assertEquals(-2000000000, v.to_nsec())
test/test_genpy_rostime.py:            self.assertEquals(-1, v.secs)
test/test_genpy_rostime.py:            self.assertEquals(0, v.nsecs)
test/test_genpy_rostime.py:            self.assertEquals(-1, v.to_sec())
test/test_genpy_rostime.py:            self.assertEquals(-1000000000, v.to_nsec())
test/test_genpy_rostime.py:        self.assertEquals(TVal(1).__hash__(), TVal(1).__hash__())
test/test_genpy_rostime.py:        self.assertEquals(TVal(1,1).__hash__(), TVal(1,1).__hash__())
test/test_genpy_rostime.py:        self.assertNotEquals(TVal(1).__hash__(), TVal(2).__hash__())
test/test_genpy_rostime.py:        self.assertNotEquals(TVal(1,1).__hash__(), TVal(1,2).__hash__())
test/test_genpy_rostime.py:        self.assertNotEquals(TVal(1,1).__hash__(), TVal(2,1).__hash__())
test/test_genpy_rostime.py:        self.failIf(failed, "should have failed to compare")
test/test_genpy_rostime.py:        self.failIf(failed, "should have failed to compare")
test/test_genpy_rostime.py:        self.failIf(failed, "negative time not allowed")
test/test_genpy_rostime.py:        self.failIf(failed, "negative time not allowed")
test/test_genpy_rostime.py:        self.assertEquals(v.to_sec(), t)
test/test_genpy_rostime.py:        self.assertEquals(Time.from_sec(0), Time())
test/test_genpy_rostime.py:        self.assertEquals(Time.from_sec(1.), Time(1))
test/test_genpy_rostime.py:        self.assertEquals(Time.from_sec(v.to_sec()), v)
test/test_genpy_rostime.py:        self.assertEquals(v.from_sec(v.to_sec()), v)
test/test_genpy_rostime.py:        self.assertEquals(v.to_sec(), v.to_time())
test/test_genpy_rostime.py:        self.failIf(failed, "Time + Time must fail")
test/test_genpy_rostime.py:        self.assertEquals(Time(2, 0), v)
test/test_genpy_rostime.py:        self.assertEquals(Time(2, 0), v)
test/test_genpy_rostime.py:        self.assertEquals(Time(2, 2), v)
test/test_genpy_rostime.py:        self.assertEquals(Time(2, 2), v)
test/test_genpy_rostime.py:        self.assertEquals(Time(2), v)
test/test_genpy_rostime.py:        self.assertEquals(Time(2), v)
test/test_genpy_rostime.py:        self.assertEquals(Time(400, 100), v)
test/test_genpy_rostime.py:        self.assertEquals(Time(400, 100), v)
test/test_genpy_rostime.py:        self.assertEquals(Time(400, 400), v)
test/test_genpy_rostime.py:        self.assertEquals(Time(400, 400), v)
test/test_genpy_rostime.py:        self.assertEquals(Time(399, 999999999), v)
test/test_genpy_rostime.py:        self.assertEquals(Time(399, 999999999), v)
test/test_genpy_rostime.py:        self.failIf(failed, "Time - non Duration must fail")
test/test_genpy_rostime.py:        self.failIf(failed, "Time - non TVal must fail")
test/test_genpy_rostime.py:        self.assertEquals(Time(), v)
test/test_genpy_rostime.py:        self.assertEquals(Time(2, 2), v)
test/test_genpy_rostime.py:        self.assertEquals(Time(), v)
test/test_genpy_rostime.py:        self.assertEquals(Time(1), v)
test/test_genpy_rostime.py:        self.assertEquals(Time(100, 100), v)
test/test_genpy_rostime.py:        self.assertEquals(Time(99, 999999999), v)
test/test_genpy_rostime.py:        self.assertEquals(Duration(), v)
test/test_genpy_rostime.py:        self.assertEquals(Duration(0,100), v)
test/test_genpy_rostime.py:        self.assertEquals(Duration(-100), v)
test/test_genpy_rostime.py:        self.assertEquals(Time.from_sec(0.5), Time(0.5))
test/test_genpy_rostime.py:        self.assertEquals(0, t.secs)
test/test_genpy_rostime.py:        self.assertEquals(500000000, t.nsecs)
test/test_genpy_rostime.py:        self.assertEquals(v, Duration.from_sec(v.to_sec()))
test/test_genpy_rostime.py:        self.assertEquals(v, v.from_sec(v.to_sec()))
test/test_genpy_rostime.py:        self.assertEquals(v, Duration.from_sec(v.to_sec()))
test/test_genpy_rostime.py:        self.assertEquals(v, v.from_sec(v.to_sec()))
test/test_genpy_rostime.py:        self.assertEquals(-1, v.secs)
test/test_genpy_rostime.py:        self.assertEquals(1, v.nsecs)
test/test_genpy_rostime.py:        self.assertEquals(1, v.secs)
test/test_genpy_rostime.py:        self.assertEquals(1, v.nsecs)
test/test_genpy_rostime.py:        self.assertEquals(0, v.secs)
test/test_genpy_rostime.py:        self.assertEquals(999999999, v.nsecs)
test/test_genpy_rostime.py:        self.assertEquals(Duration(1,0) + Time(1, 0), Time(2, 0))
test/test_genpy_rostime.py:        self.failIf(failed, "Duration + int must fail")
test/test_genpy_rostime.py:        self.assertEquals(2, v.secs)
test/test_genpy_rostime.py:        self.assertEquals(0, v.nsecs)
test/test_genpy_rostime.py:        self.assertEquals(Duration(2, 0), v)
test/test_genpy_rostime.py:        self.assertEquals(0, v.secs)
test/test_genpy_rostime.py:        self.assertEquals(0, v.nsecs)
test/test_genpy_rostime.py:        self.assertEquals(Duration(), v)
test/test_genpy_rostime.py:        self.assertEquals(2, v.secs)
test/test_genpy_rostime.py:        self.assertEquals(0, v.nsecs)
test/test_genpy_rostime.py:        self.assertEquals(Duration(2), v)
test/test_genpy_rostime.py:        self.assertEquals(Duration(400, 100), v)
test/test_genpy_rostime.py:        self.assertEquals(Duration(400, 400), v)
test/test_genpy_rostime.py:        self.assertEquals(Duration(399, 999999999), v)
test/test_genpy_rostime.py:        self.failIf(failed, "Duration - non duration must fail")
test/test_genpy_rostime.py:        self.failIf(failed, "Duration - Time must fail")
test/test_genpy_rostime.py:        self.assertEquals(Duration(), v)
test/test_genpy_rostime.py:        self.assertEquals(Duration(-3, 999999998), v)
test/test_genpy_rostime.py:        self.assertEquals(Duration(), v)
test/test_genpy_rostime.py:        self.assertEquals(Duration(1), v)
test/test_genpy_rostime.py:        self.assertEquals(Duration(-200, 100), v)
test/test_genpy_rostime.py:        self.assertEquals(Duration(-201, 999999999), v)
test/test_genpy_rostime.py:        self.assertEquals(abs(Duration()), Duration())
test/test_genpy_rostime.py:        self.assertEquals(abs(Duration(1)), Duration(1))
test/test_genpy_rostime.py:        self.assertEquals(abs(Duration(-1)), Duration(1))
test/test_genpy_rostime.py:        self.assertEquals(abs(Duration(0,-1)), Duration(0,1))
test/test_genpy_rostime.py:        self.assertEquals(abs(Duration(-1,-1)), Duration(1,1))
test/test_genpy_rostime.py:        self.assertEquals(abs(Duration(0,1)), Duration(0,1))
test/test_genpy_rostime.py:        self.assertEquals(Duration.from_sec(0.5), Duration(0.5))
test/test_genpy_rostime.py:        self.assertEquals(0, t.secs)
test/test_genpy_rostime.py:        self.assertEquals(500000000, t.nsecs)
test/test_genpy_rostime.py:        self.assertEquals(Duration(4), Duration(2) * 2)
test/test_genpy_rostime.py:        self.assertEquals(Duration(4), Duration(2) * 2.)
test/test_genpy_rostime.py:        self.assertEquals(Duration(4), 2 * Duration(2))
test/test_genpy_rostime.py:        self.assertEquals(Duration(4), 2. * Duration(2))
test/test_genpy_rostime.py:        self.assertEquals(Duration(10), Duration(4) * 2.5)
test/test_genpy_rostime.py:        self.assertEquals(Duration(4, 8), Duration(2, 4) * 2)
test/test_genpy_rostime.py:        self.assertEquals(Duration(4), Duration(8) / 2)
test/test_genpy_rostime.py:        self.assertEquals(Duration(4), Duration(8) / 2.)
test/test_genpy_rostime.py:        self.assertEquals(Duration(4, 2), Duration(8, 4) / 2)
@gbiggs
Copy link
Contributor

gbiggs commented Jan 2, 2022

Because ROS Noetic targets Python 3.8, and there are no future planned releases of ROS 1, I think it's unlikely that anyone will put in the effort to fix this. However, if a pull request is provided I see no reason why it couldn't be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants