tests: rename TestSuccess(Exception) to SuccessfulTest
The test framework did not like the "Test" prefix. ``` electrum/tests/test_lnpeer.py:305 /home/travis/build/spesmilo/electrum/electrum/tests/test_lnpeer.py:305: PytestCollectionWarning: cannot collect test class 'TestSuccess' because it has a __init__ constructor (from: electrum/tests/test_lnpeer.py) ```
This commit is contained in:
@@ -302,7 +302,7 @@ class SquareGraph(NamedTuple):
|
|||||||
|
|
||||||
|
|
||||||
class PaymentDone(Exception): pass
|
class PaymentDone(Exception): pass
|
||||||
class TestSuccess(Exception): pass
|
class SuccessfulTest(Exception): pass
|
||||||
|
|
||||||
|
|
||||||
class TestPeer(TestCaseForTestnet):
|
class TestPeer(TestCaseForTestnet):
|
||||||
@@ -936,7 +936,7 @@ class TestPeer(TestCaseForTestnet):
|
|||||||
# Dave is supposed to have failed the pending incomplete MPP HTLCs
|
# Dave is supposed to have failed the pending incomplete MPP HTLCs
|
||||||
self.assertEqual(0, len(graph.chan_dc.hm.htlcs(LOCAL)))
|
self.assertEqual(0, len(graph.chan_dc.hm.htlcs(LOCAL)))
|
||||||
self.assertEqual(0, len(graph.chan_dc.hm.htlcs(REMOTE)))
|
self.assertEqual(0, len(graph.chan_dc.hm.htlcs(REMOTE)))
|
||||||
raise TestSuccess()
|
raise SuccessfulTest()
|
||||||
|
|
||||||
async def f():
|
async def f():
|
||||||
async with TaskGroup() as group:
|
async with TaskGroup() as group:
|
||||||
@@ -946,7 +946,7 @@ class TestPeer(TestCaseForTestnet):
|
|||||||
await asyncio.sleep(0.2)
|
await asyncio.sleep(0.2)
|
||||||
await group.spawn(pay())
|
await group.spawn(pay())
|
||||||
|
|
||||||
with self.assertRaises(TestSuccess):
|
with self.assertRaises(SuccessfulTest):
|
||||||
run(f())
|
run(f())
|
||||||
|
|
||||||
@needs_test_with_all_chacha20_implementations
|
@needs_test_with_all_chacha20_implementations
|
||||||
@@ -1106,7 +1106,7 @@ class TestPeer(TestCaseForTestnet):
|
|||||||
raw_msg2 = (43333).to_bytes(length=2, byteorder="big") + bytes(range(55))
|
raw_msg2 = (43333).to_bytes(length=2, byteorder="big") + bytes(range(55))
|
||||||
p1.transport.send_bytes(raw_msg2)
|
p1.transport.send_bytes(raw_msg2)
|
||||||
await asyncio.sleep(0.05)
|
await asyncio.sleep(0.05)
|
||||||
raise TestSuccess()
|
raise SuccessfulTest()
|
||||||
|
|
||||||
async def f():
|
async def f():
|
||||||
async with TaskGroup() as group:
|
async with TaskGroup() as group:
|
||||||
@@ -1116,7 +1116,7 @@ class TestPeer(TestCaseForTestnet):
|
|||||||
await asyncio.sleep(0.2)
|
await asyncio.sleep(0.2)
|
||||||
await group.spawn(send_weird_messages())
|
await group.spawn(send_weird_messages())
|
||||||
|
|
||||||
with self.assertRaises(TestSuccess):
|
with self.assertRaises(SuccessfulTest):
|
||||||
run(f())
|
run(f())
|
||||||
|
|
||||||
@needs_test_with_all_chacha20_implementations
|
@needs_test_with_all_chacha20_implementations
|
||||||
|
|||||||
Reference in New Issue
Block a user