diff --git a/moban/main.py b/moban/main.py index a453e19b..17e75722 100644 --- a/moban/main.py +++ b/moban/main.py @@ -165,6 +165,7 @@ def handle_command_line(options): options[constants.LABEL_CONFIG], options[constants.LABEL_OUTPUT], ) + engine.report() HASH_STORE.save_hashes() exit_code = reporter.convert_to_shell_exit_code( engine.number_of_templated_files() diff --git a/moban/plugins.py b/moban/plugins.py index 67dbd058..debdb330 100644 --- a/moban/plugins.py +++ b/moban/plugins.py @@ -46,6 +46,7 @@ def number_of_templated_files(self): return self.templated_count def render_to_file(self, template_file, data_file, output_file): + self.file_count = 1 data = self.context.get_data(data_file) template = self.engine.get_template(template_file) template_abs_path = utils.get_template_path( @@ -56,6 +57,7 @@ def render_to_file(self, template_file, data_file, output_file): ) if flag: reporter.report_templating(template_file, output_file) + self.templated_count += 1 def apply_template(self, template_abs_path, template, data, output_file): rendered_content = self.engine.apply_template( diff --git a/tests/test_docs.py b/tests/test_docs.py index 80c8fdc2..1a4470b4 100644 --- a/tests/test_docs.py +++ b/tests/test_docs.py @@ -120,7 +120,10 @@ def _moban(self, folder, expected): def _raw_moban(self, args, folder, expected, output): os.chdir(os.path.join("docs", folder)) with patch.object(sys, "argv", args): - main() + try: + main() + except SystemExit as e: + eq_("1", str(e)) _verify_content(output, expected) os.unlink(output)