Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
Fixing coding standard issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
fabioz committed Oct 2, 2017
1 parent f0c0fff commit 009222a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion esss_fix_format/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ def main(files_or_directories, check, stdin, commit):
click.secho(error_msg, fg='red')
errors.append(error_msg)


sorter = isort.SortImports(file_contents=new_contents, settings_path=settings_path)
# strangely, if the entire file is skipped by an "isort:skip_file"
# instruction in the docstring, SortImports doesn't even contain an
Expand Down
5 changes: 4 additions & 1 deletion tests/test_esss_fix_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

from esss_fix_format import cli


@pytest.fixture
def sort_cfg_to_tmpdir(tmpdir):
import shutil
Expand Down Expand Up @@ -278,11 +279,13 @@ def test_force_parentheses(tmpdir, sort_cfg_to_tmpdir):
)
assert obtained == expected


def test_no_isort_cfg(tmpdir):
filename = tmpdir.join('test.py')
filename.write('import os', 'w')
output = run([str(filename)], expected_exit=1)
output.fnmatch_lines(r'*ERROR .isort.cfg not available in repository (or line_length config < 80).')
output.fnmatch_lines(
r'*ERROR .isort.cfg not available in repository (or line_length config < 80).')


def run(args, expected_exit):
Expand Down

0 comments on commit 009222a

Please sign in to comment.