def test_errprint(self):
        """Asserting result of `tabnanny.errprint()` by giving sample inputs."""
        tests = [(['first', 'second'], 'first second\n'),
                 (['first'], 'first\n'), ([1, 2, 3], '1 2 3\n'), ([], '\n')]

        for args, expected in tests:
            with self.subTest(arguments=args, expected=expected):
                with captured_stderr() as stderr:
                    tabnanny.errprint(*args)
                self.assertEqual(stderr.getvalue(), expected)
Example #2
0
    def test_errprint(self):
        """Asserting result of `tabnanny.errprint()` by giving sample inputs."""
        tests = [
            (['first', 'second'], 'first second\n'),
            (['first'], 'first\n'),
            ([1, 2, 3], '1 2 3\n'),
            ([], '\n')
        ]

        for args, expected in tests:
            with self.subTest(arguments=args, expected=expected):
                with captured_stderr() as stderr:
                    tabnanny.errprint(*args)
                self.assertEqual(stderr.getvalue() , expected)
Example #3
0
 def update_event(self, inp=-1):
     self.set_output_val(0, tabnanny.errprint())