Introduce py39 for unittests
This update is to introduce py39 for unittest via tox. After installing python3.9, you can run tests with py39. # Run unittests with py39 $ tox -e py39 # or debug $ tox -e debug-py39 For the update, replace `base64.encodestring` with `base64.encodebytes` because it has been a deplicated alias and removed in python3.9. Change-Id: I1ea2e4fb836c485cfe7690c3bf8a0791ced655d5 Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
This commit is contained in:
parent
25f93312c1
commit
14fa2846c6
@ -150,6 +150,6 @@ def _add_basic_auth(request, username, password):
|
|||||||
|
|
||||||
This function adds basic authentication information to a urllib request.
|
This function adds basic authentication information to a urllib request.
|
||||||
"""
|
"""
|
||||||
auth_str = base64.encodestring(('%s:%s' % (
|
auth_str = base64.encodebytes(('%s:%s' % (
|
||||||
username, password)).encode()).decode().strip()
|
username, password)).encode()).decode().strip()
|
||||||
request.add_header('Authorization', 'Basic %s' % auth_str)
|
request.add_header('Authorization', 'Basic %s' % auth_str)
|
||||||
|
6
tox.ini
6
tox.ini
@ -1,5 +1,5 @@
|
|||||||
[tox]
|
[tox]
|
||||||
envlist = py38,py36,pep8,docs
|
envlist = py39,py38,py36,pep8,docs
|
||||||
minversion = 3.1.1
|
minversion = 3.1.1
|
||||||
skipsdist = True
|
skipsdist = True
|
||||||
ignore_basepython_conflict = True
|
ignore_basepython_conflict = True
|
||||||
@ -40,6 +40,10 @@ commands = oslo_debug_helper {posargs}
|
|||||||
basepython = python3.6
|
basepython = python3.6
|
||||||
commands = oslo_debug_helper {posargs}
|
commands = oslo_debug_helper {posargs}
|
||||||
|
|
||||||
|
[testenv:debug-py39]
|
||||||
|
basepython = python3.9
|
||||||
|
commands = oslo_debug_helper {posargs}
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
deps = -r{toxinidir}/doc/requirements.txt
|
deps = -r{toxinidir}/doc/requirements.txt
|
||||||
-r{toxinidir}/test-requirements.txt
|
-r{toxinidir}/test-requirements.txt
|
||||||
|
Loading…
Reference in New Issue
Block a user