Make check files with python bindings.

Mike Evans mikee at saxicola.co.uk
Sat May 17 07:34:47 EDT 2014


On Sat, 17 May 2014 13:06 +0200
Geert Janssens <janssens-geert at telenet.be> wrote:

> Do you have the python-test package installed ? Fedora has separated the 
> test support from python-devel. I ran into this a few months back on 
> Fedora 19 (20?) as well.
> 
> Geert
> 
Yes I do.
Package python-test-2.7.3-13.fc18.i686 already installed and latest version

On My system:

rpm -qi --whatprovides /usr/lib/python2.7/test/test_support.py
Name        : python-libs
Version     : 2.7.3
Release     : 13.fc18
...

So test support is installed it seems.  I can "import test" but there are no modules in test.

NB: Reading the Python docs at https://docs.python.org/2/library/test.html
The top of the page says:

'''
Note

The test package is meant for internal use by Python only. It is documented for the benefit of the core developers of Python. Any use of this package outside of Python’s standard library is discouraged as code mentioned here can change or be removed without notice between releases of Python.
'''
?

Mike Evans


> On Saturday 17 May 2014 11:40:52 Mike Evans wrote:
> > On Fri, 16 May 2014 11:38:59 -0700
> > 
> > John Ralls <jralls at ceridwen.us> wrote:
> > > On May 16, 2014, at 9:24 AM, Mike Evans <mikee at saxicola.co.uk> 
> wrote:
> > > > make  check-TESTS
> > > > make[1]: Entering directory
> > > > `/home/mikee/Projects/gnucash/build/src/optional/python-bindings/
> > > > tests'> > 
> > > > Traceback (most recent call last):
> > > >  File "./runTests.py", line 8, in <module>
> > > >  
> > > >    from test import
> > > > 
> > > > ImportError: cannot import name test_support
> > > > FAIL: runTests.py
> > > > ==========================================
> > > > 1 of 1 test failed
> > > > Please report to gnucash-devel at gnucash.org
> > > > ==========================================
> > > > make[1]: *** [check-TESTS] Error 1
> > > > make[1]: Leaving directory
> > > > `/home/mikee/Projects/gnucash/build/src/optional/python-bindings/
> > > > tests' make: *** [check-am] Error 2
> > > > 
> > > > 
> > > > 
> > > > This is on Fedora18.  There is no module test_support.  Modifying
> > > > runTests.py.in as below fixes the test. ############
> > > > #!/usr/bin/python
> > > > 
> > > > import unittest
> > > > import os
> > > > 
> > > > os.environ["GNC_UNINSTALLED"] = "1"
> > > > 
> > > > #from test import test_support
> > > > 
> > > > from test_book import TestBook
> > > > from test_account import TestAccount
> > > > from test_split import TestSplit
> > > > from test_transaction import TestTransaction
> > > > from test_business import TestBusiness
> > > > 
> > > > def test_main():
> > > >    #test_support.run_unittest(TestBook, TestAccount, TestSplit,
> > > >    TestTransaction, TestBusiness) unittest.main()
> > > > 
> > > > if __name__ == '__main__':
> > > >    test_main()
> > > > 
> > > > ###############
> > > > 
> > > > This is vaguely related to bug 730255.  Adding a test for that bug
> > > > causes the test to fail again. (As it should).
> > > > 
> > > > Just wondering if I've understood the test system before I commit
> > > > and push this.> 
> > > Just a guess: You’re using Python3, where the test_support module
> > > has been renamed “support”.
> > > 
> > > If so, it should be:
> > > import sys
> > > 
> > > if sys.version_info[0] < 3:
> > >   from test import test_support
> > > 
> > > else:
> > >   from test import support as test_support
> > > 
> > > And uncomment the line test_support.run_unittest…
> > > 
> > > Regards,
> > > John Ralls
> > 
> > Hi John
> > 
> > Python 2.7.3.
> > 
> > from test import test_support
> > ImportError: cannot import name test_support
> > 
> > Mike Evans
> 



-- 
Anti NSA?  Use PGP.
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x00CDB13500D7AB53  



More information about the gnucash-devel mailing list