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.
```
This commit is contained in:
@@ -246,8 +246,9 @@ class Test_seeds(ElectrumTestCase):
|
||||
|
||||
def test_can_seed_have_passphrase(self):
|
||||
seed_invalid = 'xxx'
|
||||
with self.assertRaises(Exception):
|
||||
with self.assertRaises(Exception) as ctx:
|
||||
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'
|
||||
self.assertFalse(can_seed_have_passphrase(seed_old))
|
||||
seed_standard = 'cram swing cover prefer miss modify ritual silly deliver chunk behind inform able'
|
||||
|
||||
Reference in New Issue
Block a user