On May 16, 2014, at 9:24 AM, Mike Evans <mi...@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@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


_______________________________________________
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel

Reply via email to