Make check files with python bindings.
Mike Evans
mikee at saxicola.co.uk
Sat May 17 06:40:52 EDT 2014
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