From bf0f13f5d9924698c130e5d761ee7ff671978856 Mon Sep 17 00:00:00 2001 From: Shachar Sharon Date: Wed, 27 Sep 2023 12:00:17 +0300 Subject: [PATCH 1/3] tox: pass env variable PYTHONPATH Let tox propagate PYTHONPATH environment variable. Should clear confusing warning messages in newer tox versions. Signed-off-by: Shachar Sharon --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index becfbfd..8cb7155 100644 --- a/tox.ini +++ b/tox.ini @@ -7,6 +7,7 @@ isolated_build = True minversion = 3.9 passenv = TEST_INFO_FILE + PYTHONPATH deps = pytest commands = py.test -v . From ad4988bd004db8e712ca54f7bf4a27f5af4b2051 Mon Sep 17 00:00:00 2001 From: Shachar Sharon Date: Wed, 27 Sep 2023 12:09:41 +0300 Subject: [PATCH 2/3] tox: use explicit 'changedir' to root Run tox sub-commands from project's root directory, or else they may fail due to wrong working-dir. In particular, when using tox directly instead of via wrapper top-level Makefile (e.g.: Windows' PowerShell). Signed-off-by: Shachar Sharon --- tox.ini | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tox.ini b/tox.ini index 8cb7155..4c40ae7 100644 --- a/tox.ini +++ b/tox.ini @@ -23,14 +23,17 @@ deps = pytest pyyaml pytest-randomly +changedir = {toxinidir} commands = pytest -v testcases/consistency [testenv:flake8] deps = flake8 +changedir = {toxinidir} commands = flake8 . [testenv:black] deps = black>=23.3.0 +changedir = {toxinidir} commands = black --check -l 79 -v . [testenv:mypy] @@ -40,4 +43,5 @@ deps = types-setuptools types-pyyaml types-python-dateutil +changedir = {toxinidir} commands = mypy --no-color-output . From dd4679e659d89ff3573157548398f5615a818693 Mon Sep 17 00:00:00 2001 From: Shachar Sharon Date: Wed, 27 Sep 2023 12:18:16 +0300 Subject: [PATCH 3/3] tox: consistent indent spacing Python uses 4-space for indentation. Follow same convention in tox.ini configuration file. Signed-off-by: Shachar Sharon --- tox.ini | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tox.ini b/tox.ini index 4c40ae7..d15ec96 100644 --- a/tox.ini +++ b/tox.ini @@ -6,23 +6,23 @@ isolated_build = True [testenv] minversion = 3.9 passenv = - TEST_INFO_FILE - PYTHONPATH + TEST_INFO_FILE + PYTHONPATH deps = pytest commands = py.test -v . [testenv:pytest] deps = - pytest - pyyaml - pytest-randomly + pytest + pyyaml + pytest-randomly commands = pytest -v testcases/mount testcases/consistency testcases/smbtorture [testenv:sanity] deps = - pytest - pyyaml - pytest-randomly + pytest + pyyaml + pytest-randomly changedir = {toxinidir} commands = pytest -v testcases/consistency