|
1 | | -import json as _json |
| 1 | +import json |
2 | 2 | import logging |
3 | 3 | import os |
4 | 4 | import pathlib |
@@ -67,7 +67,7 @@ def test_cli(db_path, data_dir, monkeypatch): |
67 | 67 | expected = {'url_base': url_base, 'rel_base': rel_base} |
68 | 68 | exec(data_dir.joinpath(feed_filename + '.py').read_text(), expected) |
69 | 69 |
|
70 | | - runner = CliRunner() # remove deprecated catch_exceptions argument |
| 70 | + runner = CliRunner(catch_exceptions=False) |
71 | 71 |
|
72 | 72 | def invoke(*args): |
73 | 73 | return runner.invoke(cli, ('--db', db_path, '--feed-root', '') + args) |
@@ -119,13 +119,13 @@ def invoke(*args): |
119 | 119 |
|
120 | 120 | result = invoke('list', 'feeds', '--json') |
121 | 121 | assert result.exit_code == 0 |
122 | | - feeds = list(map(_json.loads, result.output.splitlines())) |
| 122 | + feeds = list(map(json.loads, result.output.splitlines())) |
123 | 123 | assert len(feeds) == 1 |
124 | 124 | assert feeds[0]['url'] == feed_path |
125 | 125 |
|
126 | 126 | result = invoke('list', 'entries', '--json') |
127 | 127 | assert result.exit_code == 0 |
128 | | - entries_data = list(map(_json.loads, result.output.splitlines())) |
| 128 | + entries_data = list(map(json.loads, result.output.splitlines())) |
129 | 129 | assert { |
130 | 130 | (item['feed']['url'], item['link'] or item['id']) for item in entries_data |
131 | 131 | } == {(feed_path, e.link or e.id) for e in expected['entries']} |
@@ -188,7 +188,7 @@ def raise_exception_plugin(thing): |
188 | 188 | def test_cli_plugin(db_path, monkeypatch, tests_dir): |
189 | 189 | monkeypatch.syspath_prepend(tests_dir) |
190 | 190 |
|
191 | | - runner = CliRunner(catch_exceptions=False) |
| 191 | + runner = CliRunner() |
192 | 192 |
|
193 | 193 | with pytest.raises(PluginError): |
194 | 194 | result = runner.invoke( |
|
0 commit comments