Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am working on building Python 2.7.4 on CentOS 6.4. When running the make test step, the test_gdb step fails, and I would like to get some more info as to why.

Build commands I'm running:

./configure --prefix=/usr/local/python-2.7.4 --enable-ipv6 --enable-unicode=ucs4 --enable-shared
make
make test

Output of make test:

... test test_gdb failed -- multiple errors occurred; run in verbose mode for details ...

So basically, I'm trying to figure out how to run the test_gdb test separately and in verbose mode. Sounds like I should use regrtest.py, but I seem to get invalid syntax with the various options I've tried. Any ideas?

banjer@somehost:/usr/local/src/Python-2.7.4> python Lib/test/regrtest.py -v test_gdb
  File "Lib/test/regrtest.py", line 679
    'test_support',
                  ^
SyntaxError: invalid syntax
share|improve this question
    
Usually you just need to install a bunch of devel packages. Also make sure gdb is actually installed. I think there is a "Development" group also. –  Keith Apr 24 '13 at 21:50
1  
@Keith I'll definitely need to fix gdb, and you're probably right that I'm missing some devel headers. My question is more on how to run a single make test to get more detail as to why its failing, not just for gdb. On a side note, I'm running into this MAXREPEAT bug when I skip the tests, install python with make install and run python. Thats why I'm going through and making sure all the tests come out successfully first. –  Banjer Apr 25 '13 at 12:15
    
I'm afraid that's just how the stock unittest framework works. –  Keith Apr 25 '13 at 19:52

1 Answer 1

up vote 4 down vote accepted

The actual lines around 679 in Lib/test/regrtest.py are:

NOTTESTS = {
    'test_support',
    'test_future1',
    'test_future2',
}

This defines a mutable set and is syntax back-ported from 3.1 to 2.7. This syntax is not available in 2.6 or earlier version of python.

That your test raises a syntax error is probably because your default python is pre-2.7. If you would have executed:

./python Lib/test/regrtest.py -v test_gdb
^-- this is the difference

in that directory, you would have been testing the python executable you just compiled and not the default one provided in your path. Using that executable you are unlikely to get this particular error (but maybe others that are really gdb related).

share|improve this answer
    
You nailed it. The default python in my PATH was 2.6. Using the newly compiled python instead with ./python, I was able to actually run the individual test. Cheers! –  Banjer Apr 26 '13 at 0:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.