mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-21 05:53:12 +00:00
Merge pull request #1360 from meejah/4091.fragile
Fix fragile unit-test (4091) Fixes ticket:4091
This commit is contained in:
commit
a23a97d45b
0
newsfragments/4091.minor
Normal file
0
newsfragments/4091.minor
Normal file
@ -27,7 +27,8 @@ class NoArgumentException(Exception):
|
|||||||
class HumanReadable(unittest.TestCase):
|
class HumanReadable(unittest.TestCase):
|
||||||
def test_repr(self):
|
def test_repr(self):
|
||||||
hr = humanreadable.hr
|
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),
|
self.failUnlessEqual(hr(self.test_repr),
|
||||||
"<bound method HumanReadable.test_repr of <allmydata.test.test_humanreadable.HumanReadable testMethod=test_repr>>")
|
"<bound method HumanReadable.test_repr of <allmydata.test.test_humanreadable.HumanReadable testMethod=test_repr>>")
|
||||||
self.failUnlessEqual(hr(long(1)), "1")
|
self.failUnlessEqual(hr(long(1)), "1")
|
||||||
|
Loading…
Reference in New Issue
Block a user