Merge "set default python to python3"
This commit is contained in:
commit
9618b31f71
@ -13,6 +13,8 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
import io
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
import requests
|
import requests
|
||||||
import six
|
import six
|
||||||
@ -500,16 +502,12 @@ class RequestsTransportTest(base.TestCase):
|
|||||||
|
|
||||||
if six.PY3:
|
if six.PY3:
|
||||||
builtin_open = 'builtins.open'
|
builtin_open = 'builtins.open'
|
||||||
open_mock = mock.MagicMock(name='file_handle',
|
|
||||||
spec=open)
|
|
||||||
import _io
|
|
||||||
file_spec = list(set(dir(_io.TextIOWrapper)).union(
|
|
||||||
set(dir(_io.BytesIO))))
|
|
||||||
else:
|
else:
|
||||||
builtin_open = '__builtin__.open'
|
builtin_open = '__builtin__.open'
|
||||||
open_mock = mock.MagicMock(name='file_handle',
|
open_mock = mock.MagicMock(name='file_handle',
|
||||||
spec=file)
|
spec=open)
|
||||||
file_spec = file
|
file_spec = list(set(dir(io.TextIOWrapper)).union(
|
||||||
|
set(dir(io.BytesIO))))
|
||||||
|
|
||||||
file_handle = mock.MagicMock(spec=file_spec)
|
file_handle = mock.MagicMock(spec=file_spec)
|
||||||
file_handle.write.return_value = None
|
file_handle.write.return_value = None
|
||||||
|
5
tox.ini
5
tox.ini
@ -3,6 +3,7 @@ minversion = 2.0
|
|||||||
envlist = py35,py27,pep8
|
envlist = py35,py27,pep8
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
|
basepython = python3
|
||||||
install_command = pip install {opts} {packages}
|
install_command = pip install {opts} {packages}
|
||||||
whitelist_externals = find
|
whitelist_externals = find
|
||||||
rm
|
rm
|
||||||
@ -12,6 +13,9 @@ deps =
|
|||||||
-r{toxinidir}/requirements.txt
|
-r{toxinidir}/requirements.txt
|
||||||
commands = python setup.py testr --slowest --testr-args='{posargs}'
|
commands = python setup.py testr --slowest --testr-args='{posargs}'
|
||||||
|
|
||||||
|
[testenv:py27]
|
||||||
|
basepython = python2.7
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
commands =
|
commands =
|
||||||
flake8
|
flake8
|
||||||
@ -64,7 +68,6 @@ commands = pip-missing-reqs -d --ignore-module=oslo_vmware* --ignore-file=oslo_v
|
|||||||
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
||||||
|
|
||||||
[testenv:lower-constraints]
|
[testenv:lower-constraints]
|
||||||
basepython = python3
|
|
||||||
deps =
|
deps =
|
||||||
-c{toxinidir}/lower-constraints.txt
|
-c{toxinidir}/lower-constraints.txt
|
||||||
-r{toxinidir}/test-requirements.txt
|
-r{toxinidir}/test-requirements.txt
|
||||||
|
Loading…
Reference in New Issue
Block a user