Browse Source

Call tox by specifying the tests folder to use and drop using site-packages

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
Pierre-Yves Chibon 3 years ago
parent
commit
b625e522bb
4 changed files with 7 additions and 8 deletions
  1. 1 1
      dev/containers/tox_py3.sh
  2. 2 2
      doc/contributing.rst
  3. 2 2
      doc/development.rst
  4. 2 3
      tox.ini

+ 1 - 1
dev/containers/tox_py3.sh

@@ -23,4 +23,4 @@ git --no-pager log -2
 fi
 
 export LANG="en_US.UTF-8"
-tox -v --sitepackages -e 'py38' -- --results=results
+tox -v -e 'py38' -- /pagure/tests/ --results=results

+ 2 - 2
doc/contributing.rst

@@ -13,8 +13,8 @@ If you're submitting patches to pagure, please observe the following:
   yourself (which is simple: ``black /path/to/pagure``).
 
 - Check that your code doesn't break the test suite.  The test suite can be
-  run using ``tox`` at the top of the sources, you mayuse ``tox . -e py38`` to
-  run a single version of python. You can also run a single file by calling
+  run using ``tox`` at the top of the sources, you mayuse ``tox -e py38 ./test/``
+  to run a single version of python. You can also run a single file by calling
   pytest directly: ``pytest-3 tests/test_style.py``.
   See :doc:`development` for more information about the test suite.
 

+ 2 - 2
doc/development.rst

@@ -281,11 +281,11 @@ local pagure instance.
 
 * Run it::
 
-     tox .
+     tox ./test/
 
 If you want to run a single interpreter, cou can use::
 
-     tox . -e py38
+     tox -e py38 ./test/
 
 
 Each unit-tests files (located under ``tests/``) can be called

+ 2 - 3
tox.ini

@@ -7,8 +7,6 @@ skip_missing_interpreters = True
 
 [testenv]
 usedevelop = True
-# Rely on site packages
-sitepackages = True
 deps =
     -rrequirements-testing.txt
     -rrequirements-ev.txt
@@ -17,10 +15,11 @@ deps =
     python-openid-cla
     pytest-xdist
     pytest-cov
+    pytest
 install_command =
     pip install --no-use-pep517 {opts} {packages}
 setenv =
     PAGURE_CONFIG={toxinidir}/tests/test_config
     PYTHONPATH={toxinidir}
 commands =
-    pytest -n auto tests/
+    pytest -n auto {posargs}