diff --git a/horizon/test/settings.py b/horizon/test/settings.py index fde7c12693..c48d74fee6 100644 --- a/horizon/test/settings.py +++ b/horizon/test/settings.py @@ -116,7 +116,12 @@ NOSE_ARGS = ['--nocapture', '--all-modules'] # TODO(amotoki): Need to investigate why --with-html-output # is unavailable in python3. -if six.PY2: +try: + import htmloutput # noqa: F401 + has_html_output = True +except ImportError: + has_html_output = False +if six.PY2 and has_html_output: NOSE_ARGS += ['--with-html-output', '--html-out-file=ut_horizon_nose_results.html'] diff --git a/setup.cfg b/setup.cfg index 8bf20b48ba..d6582621f3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -22,6 +22,10 @@ classifier = Programming Language :: Python :: 3.5 Topic :: Internet :: WWW/HTTP +[extras] +test = + nosehtmloutput>=0.0.3 # Apache-2.0 + [global] setup-hooks = openstack_dashboard.hooks.setup_hook diff --git a/test-requirements.txt b/test-requirements.txt index 6015f77acb..2176e0c3e2 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -18,7 +18,6 @@ mox3!=0.19.0,>=0.7.0 # Apache-2.0 nodeenv>=0.9.4 # BSD nose # LGPL nose-exclude # LGPL -nosehtmloutput>=0.0.3 # Apache-2.0 nosexcover # BSD openstack.nose-plugin>=0.7 # Apache-2.0 openstackdocstheme>=1.16.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 433e46fefb..9a030bc611 100644 --- a/tox.ini +++ b/tox.ini @@ -13,7 +13,7 @@ setenv = whitelist_externals = bash find -deps = +deps = .[test] -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands =