Allow verifying testapi 81/72281/1
authorCédric Ollivier <cedric.ollivier@orange.com>
Sun, 28 Mar 2021 17:07:15 +0000 (19:07 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Sun, 28 Mar 2021 17:08:35 +0000 (19:08 +0200)
It allows running tox vs py27 (epydoc forces py27).
It also fixes 2 indent issues.

Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Change-Id: I63e28089a56147b359a72eb330b5badbc6fc7d7f

testapi/opnfv_testapi/tests/unit/executor.py
testapi/opnfv_testapi/tests/unit/fake_pymongo.py
testapi/tox.ini

index 5a8d688..7c8cb8a 100644 (file)
@@ -18,9 +18,9 @@ O_get_secure_cookie = (
 
 
 def thread_execute(method, *args, **kwargs):
-        with ThreadPoolExecutor(max_workers=2) as executor:
-            result = executor.submit(method, *args, **kwargs)
-        return result
+    with ThreadPoolExecutor(max_workers=2) as executor:
+        result = executor.submit(method, *args, **kwargs)
+    return result
 
 
 def mock_invalid_lfid():
index 041e6e8..631e9ac 100644 (file)
@@ -15,9 +15,9 @@ from concurrent.futures import ThreadPoolExecutor
 
 
 def thread_execute(method, *args, **kwargs):
-        with ThreadPoolExecutor(max_workers=2) as executor:
-            result = executor.submit(method, *args, **kwargs)
-        return result
+    with ThreadPoolExecutor(max_workers=2) as executor:
+        result = executor.submit(method, *args, **kwargs)
+    return result
 
 
 class MemCursor(object):
index 9a06355..3092284 100644 (file)
@@ -30,10 +30,12 @@ basepython=python2.7
 commands = sphinx-build -W -b html docs/ docs/_build
 
 [testenv:pep8]
+basepython=python2.7
 deps = flake8
 commands = flake8 {toxinidir}
 
 [flake8]
+basepython=python2.7
 # H803 skipped on purpose per list discussion.
 # E123, E125 skipped as they are invalid PEP-8.
 
@@ -43,5 +45,6 @@ builtins = _
 exclude = build,dist,doc,legacy,.eggs,.git,.tox,.venv,testapi_venv,venv
 
 [pytest]
+basepython=python2.7
 testpaths = opnfv_testapi/tests
 python_functions = test_*