Skip to content

Commit

Permalink
Merge pull request #29 from jamescooke/cleanups
Browse files Browse the repository at this point in the history
Cleanups
  • Loading branch information
jamescooke committed Jun 24, 2018
2 parents dd8daf1 + 668f2b7 commit fa0d4db
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 49 deletions.
4 changes: 2 additions & 2 deletions flake8_aaa/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def check_all(self):

self.act_block = self.load_act_block()
self.arrange_block = self.load_arrange_block()
self.check_act_arrange_spacing()
self.check_arrange_act_spacing()
self.assert_block = self.load_assert_block()
self.check_act_assert_spacing()

Expand Down Expand Up @@ -101,7 +101,7 @@ def load_assert_block(self):

return None

def check_act_arrange_spacing(self):
def check_arrange_act_spacing(self):
"""
When Function has an Arrange block, then ensure that there is a blank
line between that and the Act block.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test():
ids=['no arrange'],
)
def test_no_arrange(function_with_arrange_act_blocks):
result = function_with_arrange_act_blocks.check_act_arrange_spacing()
result = function_with_arrange_act_blocks.check_arrange_act_spacing()

assert result is None

Expand Down Expand Up @@ -44,7 +44,7 @@ def test(person):
ids=['well spaced test', 'spaced test with pytest.raises'],
)
def test_has_act_block_good_spacing(function_with_arrange_act_blocks):
result = function_with_arrange_act_blocks.check_act_arrange_spacing()
result = function_with_arrange_act_blocks.check_arrange_act_spacing()

assert result is None

Expand All @@ -65,7 +65,7 @@ def test():
)
def test_missing_leading_space(function_with_arrange_act_blocks):
with pytest.raises(ValidationError) as excinfo:
function_with_arrange_act_blocks.check_act_arrange_spacing()
function_with_arrange_act_blocks.check_arrange_act_spacing()

assert excinfo.value.line_number == 5
assert excinfo.value.offset == 4
Expand Down
33 changes: 0 additions & 33 deletions tests/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,36 +34,3 @@ def test():

assert len(result.out_lines)
assert result.out_lines[0] == './test_plus.py:1:1: AAA01 no Act block found in test'


def test_ignore(flake8dir):
flake8dir.make_setup_cfg('''
[flake8]
ignore = AAA01
''')
flake8dir.make_py_files(
test_plus='''
def test():
x = 1 + 1
assert x == 2
''',
)

result = flake8dir.run_flake8()

assert result.out_lines == []


def test_act(flake8dir):
flake8dir.make_py_files(
test_plus='''
def test():
x = 1 + 1 # act
assert x == 2
''',
)

result = flake8dir.run_flake8()

assert result.out_lines == []
11 changes: 0 additions & 11 deletions tests/test_valids.py

This file was deleted.

0 comments on commit fa0d4db

Please sign in to comment.