From 9f6b03047bcb7abd952f70f13b0872bc689e2a6c Mon Sep 17 00:00:00 2001 From: Bastian Germann Date: Sat, 6 Oct 2018 22:49:13 +0200 Subject: [PATCH] Support running ./setup.py test setuptools can run tests. Use nose2 to run the tests. If it is not installed on your system, it is downloaded and temporarily used. --- openlp/core/common/registry.py | 3 +-- setup.py | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/core/common/registry.py b/openlp/core/common/registry.py index 0dab36bad..1a7cf6cfd 100644 --- a/openlp/core/common/registry.py +++ b/openlp/core/common/registry.py @@ -57,8 +57,7 @@ class Registry(object): registry.functions_list = {} registry.working_flags = {} # Allow the tests to remove Registry entries but not the live system - registry.running_under_test = 'nose' in sys.argv[0] - registry.running_under_test = 'pytest' in sys.argv[0] + registry.running_under_test = 'nose' in sys.argv[0] or 'pytest' in sys.argv[0] registry.initialising = True return registry diff --git a/setup.py b/setup.py index 67768bf88..96675fab8 100755 --- a/setup.py +++ b/setup.py @@ -201,5 +201,6 @@ using a computer and a data projector.""", 'xdg': ['pyxdg'] }, tests_require=['nose2', 'PyICU', 'pylint'], + test_suite='nose2.collector.collector', entry_points={'gui_scripts': ['openlp = openlp.__main__:start']} )