From 127d3dc9fbd64570110c320642ac8c90952a3b22 Mon Sep 17 00:00:00 2001 From: "steven.bethard" Date: Tue, 15 Sep 2009 20:40:42 +0000 Subject: Fix issue where test was reading in .pyc file instead of .py file. --- test/test_argparse.py | 11 +++++++++-- 1 file 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 -- cgit v1.2.1