[issue27594] Assertion failure when running "test_ast" tests with coverage.

2016-07-22 Thread ap

New submission from ap:

This is with a build of the default branch on OS X 10.11.6:

$ hg identify
fada654c5f72 tip
$ ./python.exe --version
Python 3.6.0a3+
$

The "test_ast" tests appear to run fine without coverage tracking enabled:

$ ./python.exe -m test test_ast
Run tests sequentially
0:00:00 [1/1] test_ast
1 test OK.
Total duration: 0:00:07
$

But when coverage tracking is enabled, an assertion fails:

$ ./python.exe -m test --coverage -D`pwd`/coverage_data test_ast
Run tests sequentially
0:00:00 [1/1] test_ast
Assertion failed: (line > 0), function _PyCode_CheckLineNumber, file 
Objects/codeobject.c, line 717.
Fatal Python error: Aborted

Current thread 0x7fff76279000 (most recent call first):
  File "test", line 0 in 
  File "/python-dev/cpython/Lib/test/test_ast.py", line 559 in 
test_level_as_none
  File "/python-dev/cpython/Lib/unittest/case.py", line 600 in run
  File "/python-dev/cpython/Lib/unittest/case.py", line 648 in __call__
  File "/python-dev/cpython/Lib/unittest/suite.py", line 122 in run
  File "/python-dev/cpython/Lib/unittest/suite.py", line 84 in __call__
  File "/python-dev/cpython/Lib/unittest/suite.py", line 122 in run
  File "/python-dev/cpython/Lib/unittest/suite.py", line 84 in __call__
  File "/python-dev/cpython/Lib/unittest/suite.py", line 122 in run
  File "/python-dev/cpython/Lib/unittest/suite.py", line 84 in __call__
  File "/python-dev/cpython/Lib/test/support/__init__.py", line 1709 in run
  File "/python-dev/cpython/Lib/test/support/__init__.py", line 1810 in 
_run_suite
  File "/python-dev/cpython/Lib/test/support/__init__.py", line 1844 in 
run_unittest
  File "/python-dev/cpython/Lib/test/libregrtest/runtest.py", line 179 in 
test_runner
  File "/python-dev/cpython/Lib/test/libregrtest/runtest.py", line 180 in 
runtest_inner
  File "/python-dev/cpython/Lib/test/libregrtest/runtest.py", line 144 in 
runtest
  File "", line 1 in 
  File "/python-dev/cpython/Lib/trace.py", line 469 in runctx
  File "/python-dev/cpython/Lib/test/libregrtest/main.py", line 330 in 
run_tests_sequential
  File "/python-dev/cpython/Lib/test/libregrtest/main.py", line 406 in run_tests
  File "/python-dev/cpython/Lib/test/libregrtest/main.py", line 466 in _main
  File "/python-dev/cpython/Lib/test/libregrtest/main.py", line 446 in main
  File "/python-dev/cpython/Lib/test/libregrtest/main.py", line 508 in main
  File "/python-dev/cpython/Lib/test/__main__.py", line 2 in 
  File "/python-dev/cpython/Lib/runpy.py", line 85 in _run_code
  File "/python-dev/cpython/Lib/runpy.py", line 184 in _run_module_as_main
Abort trap: 6
$

--
components: Tests
messages: 271038
nosy: ap
priority: normal
severity: normal
status: open
title: Assertion failure when running "test_ast" tests with coverage.
versions: Python 3.6

___
Python tracker 
<http://bugs.python.org/issue27594>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27594] Assertion failure when running "test_ast" tests with coverage.

2016-08-16 Thread ap

ap added the comment:

Thanks, Ivan, that change fixes it for me, too.

I checked with a more recent revision and build:

$ hg identify
265644bad99e+ tip
$ ./python.exe --version
Python 3.6.0a4+
$ 

Confirmed that it still exhibited the same behaviour as before:

$ ./python.exe -m test test_ast
Run tests sequentially
0:00:00 [1/1] test_ast
1 test OK.
Total duration: 0:00:06
$ 

$ ./python.exe -m test --coverage -D`pwd`/coverage_data test_ast
Run tests sequentially
0:00:00 [1/1] test_ast
Assertion failed: (line > 0), function _PyCode_CheckLineNumber, file 
Objects/codeobject.c, line 717.
Fatal Python error: Aborted

Current thread 0x7fff7b5a7000 (most recent call first):
  File "test", line 0 in 
  File "/python-dev/cpython/Lib/test/test_ast.py", line 559 in 
test_level_as_none
  File "/python-dev/cpython/Lib/unittest/case.py", line 600 in run
  File "/python-dev/cpython/Lib/unittest/case.py", line 648 in __call__
  File "/python-dev/cpython/Lib/unittest/suite.py", line 122 in run
  File "/python-dev/cpython/Lib/unittest/suite.py", line 84 in __call__
  File "/python-dev/cpython/Lib/unittest/suite.py", line 122 in run
  File "/python-dev/cpython/Lib/unittest/suite.py", line 84 in __call__
  File "/python-dev/cpython/Lib/unittest/suite.py", line 122 in run
  File "/python-dev/cpython/Lib/unittest/suite.py", line 84 in __call__
  File "/python-dev/cpython/Lib/test/support/__init__.py", line 1709 in run
  File "/python-dev/cpython/Lib/test/support/__init__.py", line 1810 in 
_run_suite
  File "/python-dev/cpython/Lib/test/support/__init__.py", line 1844 in 
run_unittest
  File "/python-dev/cpython/Lib/test/libregrtest/runtest.py", line 179 in 
test_runner
  File "/python-dev/cpython/Lib/test/libregrtest/runtest.py", line 180 in 
runtest_inner
  File "/python-dev/cpython/Lib/test/libregrtest/runtest.py", line 144 in 
runtest
  File "", line 1 in 
  File "/python-dev/cpython/Lib/trace.py", line 469 in runctx
  File "/python-dev/cpython/Lib/test/libregrtest/main.py", line 330 in 
run_tests_sequential
  File "/python-dev/cpython/Lib/test/libregrtest/main.py", line 406 in run_tests
  File "/python-dev/cpython/Lib/test/libregrtest/main.py", line 466 in _main
  File "/python-dev/cpython/Lib/test/libregrtest/main.py", line 446 in main
  File "/python-dev/cpython/Lib/test/libregrtest/main.py", line 508 in main
  File "/python-dev/cpython/Lib/test/__main__.py", line 2 in 
  File "/python-dev/cpython/Lib/runpy.py", line 85 in _run_code
  File "/python-dev/cpython/Lib/runpy.py", line 184 in _run_module_as_main
Abort trap: 6
$ 

I applied the change you suggested, and this was the result:

$ ./python.exe -m test --coverage -D`pwd`/coverage_data test_ast
Run tests sequentially
0:00:00 [1/1] test_ast
1 test OK.
lines   cov%   module   (path)
  556 1%   _collections_abc   (/python-dev/cpython/Lib/_collections_abc.py)
  14725%   _weakrefset   (/python-dev/cpython/Lib/_weakrefset.py)
   9616%   abc   (/python-dev/cpython/Lib/abc.py)
  15666%   ast   (/python-dev/cpython/Lib/ast.py)
  418 1%   codecs   (/python-dev/cpython/Lib/codecs.py)
  692 0%   collections.__init__   
(/python-dev/cpython/Lib/collections/__init__.py)
  166 8%   contextlib   (/python-dev/cpython/Lib/contextlib.py)
  31822%   dis   (/python-dev/cpython/Lib/dis.py)
   74 5%   genericpath   (/python-dev/cpython/Lib/genericpath.py)
  103 2%   importlib.__init__   
(/python-dev/cpython/Lib/importlib/__init__.py)
 1776 0%   inspect   (/python-dev/cpython/Lib/inspect.py)
 1228 0%   locale   (/python-dev/cpython/Lib/locale.py)
  170 0%   multiprocessing.process   
(/python-dev/cpython/Lib/multiprocessing/process.py)
  612 1%   os   (/python-dev/cpython/Lib/os.py)
  687 0%   platform   (/python-dev/cpython/Lib/platform.py)
  313 5%   posixpath   (/python-dev/cpython/Lib/posixpath.py)
  435 1%   sysconfig   (/python-dev/cpython/Lib/sysconfig.py)
  336 1%   test.libregrtest.main   
(/python-dev/cpython/Lib/test/libregrtest/main.py)
  17429%   test.libregrtest.runtest   
(/python-dev/cpython/Lib/test/libregrtest/runtest.py)
  19727%   test.libregrtest.save_env   
(/python-dev/cpython/Lib/test/libregrtest/save_env.py)
 1341 3%   test.support.__init__   
(/python-dev/cpython/Lib/test/support/__init__.py)
  87098%   test.test_ast   (/python-dev/cpython/Lib/test/test_ast.py)
  461 0%   trace   (/python-dev/cpython/Lib/trace.py)
  285 2%   traceback   (/python-dev/cpython/Lib/traceback.py)
  82420%   unittest.case   (/python-dev/cpython/Lib/unittest/case.py)
  329 8%   unittest.loader   (/python-dev/cpython/Lib/unittest/loader.py)
  13420%   unittest.result   (/python-dev/cpyt