Fix py35 tests
1) It's revealed that tox ran all tests under py27 instead of py27 and py35 2) Method-discovery in human api was broken under py35 because in py3 class methods are reported as functions not bound methods. Change-Id: If57a624f96d912c9f89c6c97c37cb800df96957b
This commit is contained in:
parent
7e1b15bd5c
commit
1285f3720e
|
@ -37,7 +37,8 @@ Human API understands commands like these (examples):
|
||||||
def list_actions(klazz):
|
def list_actions(klazz):
|
||||||
return set(m[0].replace('_', ' ') for m in inspect.getmembers(
|
return set(m[0].replace('_', ' ') for m in inspect.getmembers(
|
||||||
klazz,
|
klazz,
|
||||||
predicate=lambda o: inspect.ismethod(o) and hasattr(o, '__public__')))
|
predicate=lambda o: ((inspect.isfunction(o) or inspect.ismethod(o)) and
|
||||||
|
hasattr(o, '__public__'))))
|
||||||
|
|
||||||
RANDOMNESS = {'one', 'random', 'some', 'single'}
|
RANDOMNESS = {'one', 'random', 'some', 'single'}
|
||||||
RANDOMNESS_PATTERN = '|'.join(RANDOMNESS)
|
RANDOMNESS_PATTERN = '|'.join(RANDOMNESS)
|
||||||
|
|
7
tox.ini
7
tox.ini
|
@ -15,7 +15,6 @@ deps = -r{toxinidir}/test-requirements.txt
|
||||||
commands =
|
commands =
|
||||||
find . -type f -name "*.pyc" -delete
|
find . -type f -name "*.pyc" -delete
|
||||||
py.test -vvvv --html={envlogdir}/pytest_results.html --self-contained-html --durations=10 "os_faults/tests" {posargs}
|
py.test -vvvv --html={envlogdir}/pytest_results.html --self-contained-html --durations=10 "os_faults/tests" {posargs}
|
||||||
basepython = python2.7
|
|
||||||
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
|
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
|
||||||
|
|
||||||
[testenv:common-constraints]
|
[testenv:common-constraints]
|
||||||
|
@ -35,12 +34,6 @@ commands = {posargs}
|
||||||
install_command = {[testenv:common-constraints]install_command}
|
install_command = {[testenv:common-constraints]install_command}
|
||||||
commands = {posargs}
|
commands = {posargs}
|
||||||
|
|
||||||
[testenv:py34]
|
|
||||||
basepython = python3.4
|
|
||||||
|
|
||||||
[testenv:py35]
|
|
||||||
basepython = python3.5
|
|
||||||
|
|
||||||
[testenv:cover]
|
[testenv:cover]
|
||||||
commands =
|
commands =
|
||||||
py.test --cov-config .coveragerc --cov-report html --cov=os_faults "os_faults/tests"
|
py.test --cov-config .coveragerc --cov-report html --cov=os_faults "os_faults/tests"
|
||||||
|
|
Loading…
Reference in New Issue