diff options
author | steven.bethard <devnull@localhost> | 2009-09-15 20:40:42 +0000 |
---|---|---|
committer | steven.bethard <devnull@localhost> | 2009-09-15 20:40:42 +0000 |
commit | 127d3dc9fbd64570110c320642ac8c90952a3b22 (patch) | |
tree | ba02ed3ae7228a85cd483c307756133642212ce6 /test | |
parent | 7ae7db2a814b4feb1e87240a682a44157263e55b (diff) | |
download | argparse-127d3dc9fbd64570110c320642ac8c90952a3b22.tar.gz |
Fix issue where test was reading in .pyc file instead of .py file.
Diffstat (limited to 'test')
-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 |