summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIan Cordasco <graffatcolmingov@gmail.com>2016-06-04 12:37:56 -0500
committerIan Cordasco <graffatcolmingov@gmail.com>2016-06-04 12:39:11 -0500
commit9c2e747528766efdabcd48a7651d8e5206217d11 (patch)
tree3cb2b28cf787eb65d054dfea38c1789971bb2e3d /tests
parent250005b100a4d932643e169027fc6cfe78dff520 (diff)
downloadflake8-9c2e747528766efdabcd48a7651d8e5206217d11.tar.gz
Add tests around BaseFormatter#after_init
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/test_base_formatter.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/unit/test_base_formatter.py b/tests/unit/test_base_formatter.py
index 625e4c1..879ca35 100644
--- a/tests/unit/test_base_formatter.py
+++ b/tests/unit/test_base_formatter.py
@@ -101,3 +101,17 @@ def test_write_uses_print(print_function):
mock.call(line),
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