|
4 | 4 | def test_remove_duplicates(): |
5 | 5 | from pylama.errors import Error, remove_duplicates |
6 | 6 |
|
7 | | - errors = [Error(source='pycodestyle', text='E701'), Error(source='pylint', text='C0321')] |
| 7 | + errors = [ |
| 8 | + Error(source="pycodestyle", text="E701"), |
| 9 | + Error(source="pylint", text="C0321"), |
| 10 | + ] |
8 | 11 | errors = list(remove_duplicates(errors)) |
9 | 12 | assert len(errors) == 1 |
10 | 13 |
|
11 | 14 |
|
12 | 15 | def test_checkpath(parse_options): |
13 | 16 | from pylama.main import check_paths |
14 | 17 |
|
15 | | - path = op.abspath('dummy.py') |
| 18 | + path = op.abspath("dummy.py") |
16 | 19 | options = parse_options([path]) |
17 | 20 | result = check_paths(None, options) |
18 | 21 | assert result |
19 | | - assert result[0].filename == 'dummy.py' |
| 22 | + assert result[0].filename == "dummy.py" |
20 | 23 |
|
21 | 24 |
|
22 | 25 | def test_run_with_code(run, parse_options): |
23 | | - options = parse_options(linters='pyflakes') |
24 | | - errors = run('filename.py', code='unknown_call()', options=options) |
| 26 | + options = parse_options(linters="pyflakes") |
| 27 | + errors = run("filename.py", code="unknown_call()", options=options) |
| 28 | + assert errors |
| 29 | + |
| 30 | + |
| 31 | +def test_run_empty_code(run, parse_options): |
| 32 | + options = parse_options(linters="pyflakes") |
| 33 | + errors = run("filename.py", code="", options=options) |
25 | 34 | assert errors |
26 | 35 |
|
27 | 36 |
|
28 | 37 | def test_async(parse_options): |
29 | 38 | from pylama.check_async import check_async |
30 | 39 |
|
31 | 40 | options = parse_options(config=False) |
32 | | - errors = check_async(['dummy.py'], options=options, rootdir='.') |
| 41 | + errors = check_async(["dummy.py"], options=options, rootdir=".") |
33 | 42 | assert errors |
34 | 43 |
|
35 | 44 |
|
|
0 commit comments