cpython: f2991b52157e (original) (raw)

--- a/Lib/test/test_calendar.py +++ b/Lib/test/test_calendar.py @@ -471,6 +471,9 @@ class LeapdaysTestCase(unittest.TestCase self.assertEqual(calendar.leapdays(1997,2020), 5) +def conv(s):

+ class CommandLineTestCase(unittest.TestCase): def run_ok(self, *args): return assert_python_ok('-m', 'calendar', *args)[1] @@ -501,17 +504,17 @@ class CommandLineTestCase(unittest.TestC def test_output_year(self): stdout = self.run_ok('2004')

def test_output_month(self): stdout = self.run_ok('2004', '1')

def test_option_encoding(self): self.assertFailure('-e') self.assertFailure('--encoding') stdout = self.run_ok('--encoding', 'rot-13', '2004')

def test_option_locale(self): self.assertFailure('-L') @@ -543,7 +546,7 @@ class CommandLineTestCase(unittest.TestC self.assertFailure('--lines') self.assertFailure('-l', 'spam') stdout = self.run_ok('--lines', '2', '2004')

def test_option_spacing(self): self.assertFailure('-s') @@ -557,14 +560,14 @@ class CommandLineTestCase(unittest.TestC self.assertFailure('--month') self.assertFailure('-m', 'spam') stdout = self.run_ok('--months', '1', '2004')

def test_option_type(self): self.assertFailure('-t') self.assertFailure('--type') self.assertFailure('-t', 'spam') stdout = self.run_ok('--type', 'text', '2004')

@@ -579,7 +582,7 @@ class CommandLineTestCase(unittest.TestC def test_html_output_year_encoding(self): stdout = self.run_ok('-t', 'html', '--encoding', 'ascii', '2004')

def test_html_output_year_css(self): self.assertFailure('-t', 'html', '-c')