The branch, master has been updated via 470d10d15b4783be8f46a480527afa11ea05a89f (commit) from 56b1c6d8ed8b6e1812ff0310c3f72c78c232bf4e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 470d10d15b4783be8f46a480527afa11ea05a89f Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Oct 1 19:42:43 2013 +0200 Make test_suite callable via setup.py. ----------------------------------------------------------------------- Summary of changes: debian/changelog | 1 + setup.py | 1 + x2gobroker/tests/runalltests.py | 22 +++++++++++++--------- 3 files changed, 15 insertions(+), 9 deletions(-) The diff of changes is: diff --git a/debian/changelog b/debian/changelog index 8bcced1..780dc54 100644 --- a/debian/changelog +++ b/debian/changelog @@ -24,6 +24,7 @@ x2gobroker (0.0.3.0-0~x2go1) UNRELEASED; urgency=low - Rename base broker's use_session_autologin to get_session_autologin. - Fix Python2'isms in three exceptions. Thanks to Mathias Ewald for spotting. + - Make test_suite callable via setup.py. * /debian/control: + Replace LDAP support with session brokerage support in LONG_DESCRIPTION. * /debian/x2gobroker-agent.dirs: diff --git a/setup.py b/setup.py index a5eb5f8..928ef07 100755 --- a/setup.py +++ b/setup.py @@ -44,4 +44,5 @@ setup( packages = find_packages('.'), package_dir = {'': '.'}, test_suite = "x2gobroker.tests.runalltests", + use_2to3 = True, ) diff --git a/x2gobroker/tests/runalltests.py b/x2gobroker/tests/runalltests.py index f0156db..35d978b 100644 --- a/x2gobroker/tests/runalltests.py +++ b/x2gobroker/tests/runalltests.py @@ -26,12 +26,17 @@ fine for any kind of Python unit testing---as we do here for Python X2GoBroker. import os import sys -base = os.path.join(os.path.split(os.path.split(os.getcwd())[0])[0]) - -try: - import x2gobroker -except ImportError: - sys.path.insert(0, os.path.join(os.getcwd(), '../..')) +if os.path.exists('runalltests.py'): + # test is evoked via test.py + pass +else: + # test is evoked via setup.py + os.environ.update({'X2GOBROKER_DEBUG': "1"}) + os.environ.update({'X2GOBROKER_TESTSUITE': "1"}) + os.chdir(os.path.join('x2gobroker', 'tests',)) + +base = os.getcwd() +sys.path.insert(0, os.path.join(os.path.split(os.path.split(os.getcwd())[0])[0])) # prepend the X2GoBroker path (useful for building new packages) sys.path = [os.path.normpath(base)] + sys.path @@ -40,7 +45,7 @@ import unittest TestRunner = unittest.TextTestRunner suite = unittest.TestSuite() -tests = os.listdir(os.curdir) +tests = os.listdir(base) tests = [n[:-3] for n in tests if n.startswith('test') and n.endswith('.py')] for test in tests: @@ -48,5 +53,4 @@ for test in tests: if hasattr(m, 'test_suite'): suite.addTest(m.test_suite()) -if __name__ == '__main__': - TestRunner().run(suite) +TestRunner().run(suite) hooks/post-receive -- x2gobroker.git (HTTP(S) Session broker for X2Go) This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "x2gobroker.git" (HTTP(S) Session broker for X2Go).