From dde333ef109d135e23b9f6e08ab11f855ff66f15 Mon Sep 17 00:00:00 2001 From: Anusha Ramineni Date: Mon, 10 Oct 2016 09:26:55 +0530 Subject: [PATCH] Enable tox to run unit tests Change-Id: I5517be776cd240133c8f8aee0863c80a567d0591 Partially-Implements: tox-testcases --- .testr.conf | 7 +++++++ tox.ini | 2 +- valence/tests/functional/__init__.py | 0 valence/tests/{ => functional}/test_functional.py | 0 valence/tests/unit/__init__.py | 0 valence/tests/{ => unit}/test_units.py | 0 6 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .testr.conf create mode 100644 valence/tests/functional/__init__.py rename valence/tests/{ => functional}/test_functional.py (100%) create mode 100644 valence/tests/unit/__init__.py rename valence/tests/{ => unit}/test_units.py (100%) diff --git a/.testr.conf b/.testr.conf new file mode 100644 index 0000000..32dc624 --- /dev/null +++ b/.testr.conf @@ -0,0 +1,7 @@ +[DEFAULT] +test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ + OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \ + OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \ + ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./valence/tests/unit} $LISTOPT $IDOPTION +test_id_option=--load-list $IDFILE +test_list_option=--list diff --git a/tox.ini b/tox.ini index 8ac56c5..5894cef 100644 --- a/tox.ini +++ b/tox.ini @@ -11,7 +11,7 @@ install_command = setenv = VIRTUAL_ENV={envdir} deps = -r{toxinidir}/test-requirements.txt -commands = python setup.py test --slowest --testr-args='{posargs}' +commands = python setup.py testr --slowest --testr-args='{posargs}' [testenv:common-constraints] install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} diff --git a/valence/tests/functional/__init__.py b/valence/tests/functional/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/valence/tests/test_functional.py b/valence/tests/functional/test_functional.py similarity index 100% rename from valence/tests/test_functional.py rename to valence/tests/functional/test_functional.py diff --git a/valence/tests/unit/__init__.py b/valence/tests/unit/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/valence/tests/test_units.py b/valence/tests/unit/test_units.py similarity index 100% rename from valence/tests/test_units.py rename to valence/tests/unit/test_units.py