mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-18 20:47:54 +00:00
Fix fragile unit-test
This commit is contained in:
parent
3afd2dcdc7
commit
825e42cdfb
0
newsfragments/4091.minor
Normal file
0
newsfragments/4091.minor
Normal file
@ -27,7 +27,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")
|
||||
|
Loading…
Reference in New Issue
Block a user