[PATCH 2 of 2 v2] tests: restrict pytest test collection to kallithea/tests

Thomas De Schampheleire patrickdepinguin at gmail.com
Thu May 14 15:47:44 EDT 2015


# HG changeset patch
# User Thomas De Schampheleire <thomas.de.schampheleire at gmail.com>
# Date 1431632546 -7200
#      Thu May 14 21:42:26 2015 +0200
# Node ID 1446e9c945e802ed9288a9e091343d6a2bb02e9b
# Parent  e19127e4040d1817bbec77118ca7377644f76a64
tests: restrict pytest test collection to kallithea/tests

When the kallithea root directory contains a populated virtualenv, pytest
would also collect tests in python packages installed there.

Restrict the tests to be considered to any test_*.py file inside
kallithea/tests.

Additionally, by renaming unwanted test files in kallithea/tests/scripts to
_not_ match this pattern, we can completely get rid of the 'norecursedirs'
option.

diff --git a/kallithea/tests/scripts/test_concurency.py b/kallithea/tests/scripts/manual_test_concurrency.py
rename from kallithea/tests/scripts/test_concurency.py
rename to kallithea/tests/scripts/manual_test_concurrency.py
diff --git a/kallithea/tests/scripts/test_crawler.py b/kallithea/tests/scripts/manual_test_crawler.py
rename from kallithea/tests/scripts/test_crawler.py
rename to kallithea/tests/scripts/manual_test_crawler.py
diff --git a/setup.cfg b/setup.cfg
--- a/setup.cfg
+++ b/setup.cfg
@@ -11,7 +11,8 @@ detailed-errors = 1
 nologcapture = 1
 
 [pytest]
-norecursedirs = .* *.egg kallithea/tests/scripts
+# only look for tests in kallithea/tests
+python_files = kallithea/tests/**/test_*.py
 
 [compile_catalog]
 domain = kallithea


More information about the kallithea-general mailing list