Merge remote-tracking branch 'origin/master' into remove-future

This commit is contained in:
Itamar Turner-Trauring 2024-02-27 15:32:31 -05:00
commit a32526a2c6
2 changed files with 2 additions and 1 deletions

0
newsfragments/4091.minor Normal file
View File

View File

@ -22,7 +22,8 @@ class NoArgumentException(Exception):
class HumanReadable(unittest.TestCase):
def test_repr(self):
hr = humanreadable.hr
self.failUnlessEqual(hr(foo), "<foo() at test_humanreadable.py:20>")
# we match on regex so this test isn't fragile about line-numbers
self.assertRegex(hr(foo), r"<foo\(\) at test_humanreadable.py:\d+>")
self.failUnlessEqual(hr(self.test_repr),
"<bound method HumanReadable.test_repr of <allmydata.test.test_humanreadable.HumanReadable testMethod=test_repr>>")
self.failUnlessEqual(hr(long(1)), "1")