Merge "Replace nosetests with pytest"

This commit is contained in:
Jenkins
2015-07-30 15:35:58 +00:00
committed by Gerrit Code Review
4 changed files with 13 additions and 15 deletions

View File

@@ -21,7 +21,7 @@ import tarfile
import time
import mock
import nose
import pytest
import requests
from six import moves as six_moves
@@ -33,6 +33,9 @@ from fuelclient.tests import base
from fuelclient.tests import utils
@pytest.mark.skipif(not profiler.profiling_enabled(),
reason='Performance profiling tests are not '
'enabled in settings.yaml')
class ClientPerfTest(base.UnitTestCase):
NUMBER_OF_NODES = 100
@@ -40,11 +43,6 @@ class ClientPerfTest(base.UnitTestCase):
@classmethod
def setUpClass(cls):
super(ClientPerfTest, cls).setUpClass()
if not profiler.profiling_enabled():
raise nose.SkipTest('Performance profiling tests are not '
'enabled in settings.yaml')
cls.nodes = cls.get_random_nodes(cls.NUMBER_OF_NODES)
settings = fuelclient_settings.get_settings()
test_base = settings.PERF_TESTS_PATHS['perf_tests_base']

View File

@@ -31,10 +31,9 @@ NAILGUN_CHECK_URL=${NAILGUN_CHECK_URL:-"http://0.0.0.0:$NAILGUN_PORT/api/version
NAILGUN_START_MAX_WAIT_TIME=${NAILGUN_START_MAX_WAIT_TIME:-10}
TEST_NAILGUN_DB=${TEST_NAILGUN_DB:-nailgun}
# nosetest xunit options
# pytest options
ARTIFACTS=${ARTIFACTS:-$(pwd)/test_run}
FUELCLIENT_XUNIT=${FUELCLIENT_XUNIT:-"$ROOT/fuelclient.xml"}
TEST_WORKERS=${TEST_WORKERS:-0}
FUELCLIENT_JUNIT=${FUELCLIENT_JUNIT:-"$ROOT/fuelclient.xml"}
# A POSIX variable
OPTIND=1
@@ -195,7 +194,7 @@ run_cli_tests() {
# run tests
NAILGUN_CONFIG=$config LISTEN_PORT=$NAILGUN_PORT \
NAILGUN_ROOT=$NAILGUN_ROOT tox -e$env_to_run -- -vv $testropts \
${certain_tests[@]} --xunit-file $FUELCLIENT_XUNIT || return 1
${certain_tests[@]} --junit-xml $FUELCLIENT_JUNIT || return 1
popd > /dev/null
return 0

View File

@@ -1,8 +1,8 @@
hacking==0.7
mock==1.0.1
nose<=1.3.1
nose2==0.4.1
nose-timer==0.2.0
unittest2==0.5.1
pyprof2calltree==1.3.2
gprof2dot==2014.09.29
requests-mock>=0.6.0
pytest==2.7.2
pytest-cov==2.0.0

View File

@@ -10,7 +10,7 @@ setenv = VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
nosetests {posargs:fuelclient}
py.test {posargs:fuelclient}
[tox:jenkins]
downloadcache = ~/cache/pip
@@ -22,7 +22,8 @@ commands =
flake8 {posargs:fuelclient}
[testenv:cover]
setenv = NOSE_WITH_COVERAGE=1
commands =
py.test --cov={posargs:fuelclient} tests/
[testenv:venv]
commands = {posargs:}