From 9457b509cfa6adad4247882aa537f68a814c0c39 Mon Sep 17 00:00:00 2001 From: Tomas Janousek Date: Sun, 28 Jun 2020 23:18:58 +0200 Subject: [PATCH] tests: Simplify MultiSyntaxIntegrationTest.test_execute Remove duplicated code. --- tests/base.py | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/tests/base.py b/tests/base.py index a41d390..dc2410a 100644 --- a/tests/base.py +++ b/tests/base.py @@ -253,45 +253,18 @@ class MultiSyntaxIntegrationTest(IntegrationTest): pass def test_execute(self, test_syntax): - # Set markup syntax markup, header_expand = test_syntax self.markup = markup - # First, run sanity checks - success = False - - for i in range(5): - if self.check_sanity(soft=True): - success = True - break - else: - self.teardown() - self.setup() - - if not success: - self.check_sanity(soft=False) - - # Then load the input if self.viminput: # Expand HEADER self.viminput = header_expand(self.viminput) - # Unindent the lines - lines = [self.fill_uuid(line[4:]) - for line in self.viminput.strip('\n').splitlines()] - self.write_buffer(lines) - - # Do the stuff - self.execute() - - # Check expected output if self.vimoutput: + # Expand HEADER self.vimoutput = header_expand(self.vimoutput) - lines = [ - self.fill_uuid(line[4:]) - for line in self.vimoutput.strip('\n').splitlines()[:-1] - ] - assert self.read_buffer() == lines + + super(MultiSyntaxIntegrationTest, self).test_execute() class MultipleSourceTest(IntegrationTest):