diff options
-rw-r--r-- | test/test_argparse.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/test/test_argparse.py b/test/test_argparse.py index ba19835..263baea 100644 --- a/test/test_argparse.py +++ b/test/test_argparse.py @@ -3916,11 +3916,18 @@ class TestNamespace(TestCase): class TestEncoding(TestCase): + def _test_module_encoding(self, path): + if path.endswith('.pyc'): + return path[:-1] + else: + return path + codecs.open(path, 'r', 'utf8').read() + def test_argparse_module_encoding(self): - text = codecs.open(argparse.__file__, 'r', 'utf8').read() + self._test_module_encoding(argparse.__file__) def test_test_argparse_module_encoding(self): - text = codecs.open(__file__, 'r', 'utf8').read() + self._test_module_encoding(__file__) # =================== # ArgumentError tests |