mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-14 16:34:46 +00:00
Add tests around BaseFormatter#after_init
This commit is contained in:
parent
250005b100
commit
9c2e747528
1 changed files with 14 additions and 0 deletions
|
|
@ -101,3 +101,17 @@ def test_write_uses_print(print_function):
|
||||||
mock.call(line),
|
mock.call(line),
|
||||||
mock.call(source),
|
mock.call(source),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
class AfterInitFormatter(base.BaseFormatter):
|
||||||
|
"""Subclass for testing after_init."""
|
||||||
|
|
||||||
|
def after_init(self):
|
||||||
|
"""Define method to verify operation."""
|
||||||
|
self.post_initialized = True
|
||||||
|
|
||||||
|
|
||||||
|
def test_after_init_is_always_called():
|
||||||
|
"""Verify after_init is called."""
|
||||||
|
formatter = AfterInitFormatter()
|
||||||
|
assert getattr(formatter, 'post_initialized') is True
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue