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:
Yasufumi Ogawa 2020-11-08 06:05:05 +00:00
parent 25f93312c1
commit 14fa2846c6
2 changed files with 6 additions and 2 deletions

View File

@ -150,6 +150,6 @@ def _add_basic_auth(request, username, password):
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()
request.add_header('Authorization', 'Basic %s' % auth_str)

View File

@ -1,5 +1,5 @@
[tox]
envlist = py38,py36,pep8,docs
envlist = py39,py38,py36,pep8,docs
minversion = 3.1.1
skipsdist = True
ignore_basepython_conflict = True
@ -40,6 +40,10 @@ commands = oslo_debug_helper {posargs}
basepython = python3.6
commands = oslo_debug_helper {posargs}
[testenv:debug-py39]
basepython = python3.9
commands = oslo_debug_helper {posargs}
[testenv:pep8]
deps = -r{toxinidir}/doc/requirements.txt
-r{toxinidir}/test-requirements.txt