Browse Source

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)
```
patch-4
SomberNight 4 years ago
parent
commit
50b165fc3b
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 10
      electrum/tests/test_lnpeer.py

10
electrum/tests/test_lnpeer.py

@ -302,7 +302,7 @@ class SquareGraph(NamedTuple):
class PaymentDone(Exception): pass
class TestSuccess(Exception): pass
class SuccessfulTest(Exception): pass
class TestPeer(TestCaseForTestnet):
@ -936,7 +936,7 @@ class TestPeer(TestCaseForTestnet):
# 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(REMOTE)))
raise TestSuccess()
raise SuccessfulTest()
async def f():
async with TaskGroup() as group:
@ -946,7 +946,7 @@ class TestPeer(TestCaseForTestnet):
await asyncio.sleep(0.2)
await group.spawn(pay())
with self.assertRaises(TestSuccess):
with self.assertRaises(SuccessfulTest):
run(f())
@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))
p1.transport.send_bytes(raw_msg2)
await asyncio.sleep(0.05)
raise TestSuccess()
raise SuccessfulTest()
async def f():
async with TaskGroup() as group:
@ -1116,7 +1116,7 @@ class TestPeer(TestCaseForTestnet):
await asyncio.sleep(0.2)
await group.spawn(send_weird_messages())
with self.assertRaises(TestSuccess):
with self.assertRaises(SuccessfulTest):
run(f())
@needs_test_with_all_chacha20_implementations

Loading…
Cancel
Save