Esempio n. 1
0
    def test_filtered(self):
        stub_stdouts(self)
        parser = ArgumentParser()
        with self.assertRaises(SystemExit):
            parser.error('some random other error')

        self.assertIn('some random other error', sys.stderr.getvalue())
Esempio n. 2
0
    def test_filtered(self):
        stub_stdouts(self)
        parser = ArgumentParser()
        with self.assertRaises(SystemExit):
            parser.error('some random other error')

        self.assertIn('some random other error', sys.stderr.getvalue())
Esempio n. 3
0
 def test_error(self):
     stub_stdouts(self)
     parser = ArgumentParser()
     parser.error(_('too few arguments'))
     self.assertEqual('', sys.stdout.getvalue())
     self.assertEqual('', sys.stderr.getvalue())
Esempio n. 4
0
 def test_error(self):
     stub_stdouts(self)
     parser = ArgumentParser()
     parser.error(_('too few arguments'))
     self.assertEqual('', sys.stdout.getvalue())
     self.assertEqual('', sys.stderr.getvalue())