From 29f528927322bb8e3ca326399367c33225b492b5 Mon Sep 17 00:00:00 2001 From: drebs Date: Mon, 15 Aug 2016 20:39:06 -0300 Subject: [test] allow for shell autocomplete for test names tox was configured to change to the testing/tests directory before executing pytest, by using tox's "changedir" configuration option. The reason why this was the case is that we wanted to discover tests inside the testing/tests directory only. The problem with that approach is that if we wanted to point to a specific test file, for example "tests/perf/test_sync.py", we would have to omit the "tests" part and write "tox perf/test_sync.py" because the argument would be understood as relative to the changed dir. That is not practical as doesn't allow to use the shell autocomplete, and is also not the only way to achieve what we want. Actually, pytest has a configuration option called "testpaths" where you can indicate where it should discover tests. This commit changes one approach by the other and allows to user shell autocomplete for easyness of testing during development. --- testing/pytest.ini | 3 +++ testing/tests/pytest.ini | 2 -- testing/tox.ini | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 testing/pytest.ini delete mode 100644 testing/tests/pytest.ini (limited to 'testing') diff --git a/testing/pytest.ini b/testing/pytest.ini new file mode 100644 index 00000000..2d34c607 --- /dev/null +++ b/testing/pytest.ini @@ -0,0 +1,3 @@ +[pytest] +testpaths = tests +norecursedirs = tests/perf diff --git a/testing/tests/pytest.ini b/testing/tests/pytest.ini deleted file mode 100644 index 3d785ca7..00000000 --- a/testing/tests/pytest.ini +++ /dev/null @@ -1,2 +0,0 @@ -[pytest] -norecursedirs = perf diff --git a/testing/tox.ini b/testing/tox.ini index a25bc1e6..a7d62189 100644 --- a/testing/tox.ini +++ b/testing/tox.ini @@ -3,7 +3,6 @@ envlist = py27 [testenv] commands = py.test {posargs} -changedir = tests deps = pytest pytest-twisted -- cgit v1.2.3