Browse Source

soothe flake8

```
./tests/test_mnemonic.py:249:9: B017 `assertRaises(Exception)` and `pytest.raises(Exception)` should be considered evil. They can lead to your test passing even if the code being tested is never executed due to a typo. Assert for a more specific exception (builtin or custom), or use `assertRaisesRegex` (if using `assertRaises`), or add the `match` keyword argument (if using `pytest.raises`), or use the context manager form with a target.
        with self.assertRaises(Exception):
        ^
1     B017 `assertRaises(Exception)` and `pytest.raises(Exception)` should be considered evil. They can lead to your test passing even if the code being tested is never executed due to a typo. Assert for a more specific exception (builtin or custom), or use `assertRaisesRegex` (if using `assertRaises`), or add the `match` keyword argument (if using `pytest.raises`), or use the context manager form with a target.
```
master
SomberNight 2 years ago
parent
commit
300b986782
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 3
      tests/test_mnemonic.py

3
tests/test_mnemonic.py

@ -246,8 +246,9 @@ class Test_seeds(ElectrumTestCase):
def test_can_seed_have_passphrase(self): def test_can_seed_have_passphrase(self):
seed_invalid = 'xxx' seed_invalid = 'xxx'
with self.assertRaises(Exception): with self.assertRaises(Exception) as ctx:
self.assertFalse(can_seed_have_passphrase(seed_invalid)) self.assertFalse(can_seed_have_passphrase(seed_invalid))
self.assertTrue("unexpected seed type" in ctx.exception.args[0])
seed_old = 'cell dumb heartbeat north boom tease ship baby bright kingdom rare squeeze' seed_old = 'cell dumb heartbeat north boom tease ship baby bright kingdom rare squeeze'
self.assertFalse(can_seed_have_passphrase(seed_old)) self.assertFalse(can_seed_have_passphrase(seed_old))
seed_standard = 'cram swing cover prefer miss modify ritual silly deliver chunk behind inform able' seed_standard = 'cram swing cover prefer miss modify ritual silly deliver chunk behind inform able'

Loading…
Cancel
Save