Hi,

I've programmed a custom distutils command to run my unit tests. The
important part looks like this:

def __runTests(self):
    '''
    Runs all unit tests found in the folder 'test'.
    '''

    print "--- start run tests"

    # append the build path to the pythonpath
    sys.path.append(self.__buildDir)

    # append test path to pythonpath
    sys.path.append(os.path.join(os.getcwd(), "test"))

    testFiles = self.__findTestModules()

    print "--- before load tests"

    tests = TestLoader().loadTestsFromNames(testFiles)

    print "--- after load tests"

    t = TextTestRunner(verbosity = 1)
    t.run(tests)

As you can see, I've added a few print statements to explain my problem.

Now a part of my system uses pygtk and is used by one of the unit tests
that are being loaded in the code above. The module using pygtk works
without problem - but not within the unit tests. There I get a
segmentation fault while importing gtk. The import at the top of that
module looks like this:

print "--- before import pygtk"
import pygtk
print "--- after import pygtk"
pygtk.require('2.0')
print "--- after require"
import gtk
print "--- after import pygtk"

Running the tests I get this output:

--- start run tests
--- before load tests
--- before import pygtk
--- after import pygtk
--- after require
Segmentation fault

What could be the problem? Running python 2.4 on Gentoo Linux with pygtk
2.12.0

Thanks in advance.

Johannes



Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to