hhatto/autopep8 — Issue #8: recent changes break tests for Python3 
Author: Xarthisius
Created: 2012-02-26 21:19:54+00:00
State: open

Hi,
all test_w602_* fail with python3 in 0.5.1 and current HEAD:

* Testing of dev-python/autopep8-0.5.1 with CPython 3.2...
..........................................................Traceback (most recent call last):
File "/var/tmp/portage/dev-python/autopep8-0.5.1/work/autopep8-0.5.1/autopep8.py", line 688, in
sys.exit(main())
File "/var/tmp/portage/dev-python/autopep8-0.5.1/work/autopep8-0.5.1/autopep8.py", line 684, in main
fix_file(args[0], opts)
File "/var/tmp/portage/dev-python/autopep8-0.5.1/work/autopep8-0.5.1/autopep8.py", line 629, in fix_file
fixed_source = fix.fix()
File "/var/tmp/portage/dev-python/autopep8-0.5.1/work/autopep8-0.5.1/autopep8.py", line 162, in fix
self._fix_source()
File "/var/tmp/portage/dev-python/autopep8-0.5.1/work/autopep8-0.5.1/autopep8.py", line 137, in _fix_source
modified_lines = fix(result)
File "/var/tmp/portage/dev-python/autopep8-0.5.1/work/autopep8-0.5.1/autopep8.py", line 484, in fix_w602
ast_body = ast.parse(line[indent_offset:]).body[0]
File "/usr/lib64/python3.2/ast.py", line 36, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "", line 1
raise ValueError, "info", traceback
^
SyntaxError: invalid syntax
FTraceback (most recent call last):
File "/var/tmp/portage/dev-python/autopep8-0.5.1/work/autopep8-0.5.1/autopep8.py", line 688, in
sys.exit(main())
File "/var/tmp/portage/dev-python/autopep8-0.5.1/work/autopep8-0.5.1/autopep8.py", line 684, in main
fix_file(args[0], opts)
File "/var/tmp/portage/dev-python/autopep8-0.5.1/work/autopep8-0.5.1/autopep8.py", line 629, in fix_file
fixed_source = fix.fix()
File "/var/tmp/portage/dev-python/autopep8-0.5.1/work/autopep8-0.5.1/autopep8.py", line 162, in fix
self._fix_source()
File "/var/tmp/portage/dev-python/autopep8-0.5.1/work/autopep8-0.5.1/autopep8.py", line 137, in _fix_source
modified_lines = fix(result)
File "/var/tmp/portage/dev-python/autopep8-0.5.1/work/autopep8-0.5.1/autopep8.py", line 484, in fix_w602
ast_body = ast.parse(line[indent_offset:]).body[0]
File "/usr/lib64/python3.2/ast.py", line 36, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "", line 1
raise ValueError, "info", traceback # comment
^
SyntaxError: invalid syntax
F........test/test_autopep8.py:544: DeprecationWarning: Please use assertEqual instead.
self.assertEquals(f.read(), fixed)
.........
======================================================================
FAIL: test_w602_raise_argument_triple (__main__.TestFixPEP8Warning)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test/test_autopep8.py", line 455, in test_w602_raise_argument_triple
self.assertEqual(self.result, fixed)
AssertionError: '' != 'raise ValueError("info"), None, traceback\n'
+ raise ValueError("info"), None, traceback

======================================================================
FAIL: test_w602_raise_argument_triple_with_comment (__main__.TestFixPEP8Warning)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test/test_autopep8.py", line 461, in test_w602_raise_argument_triple_with_comment
self.assertEqual(self.result, fixed)
AssertionError: '' != 'raise ValueError("info"), None, traceback # comment\n'
+ raise ValueError("info"), None, traceback # comment