John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/233194

Change subject: PYWIKIBOT_TEST_MODULES to limit modules tested
......................................................................

PYWIKIBOT_TEST_MODULES to limit modules tested

Change-Id: I342c012235c260717cf29e847dc9634988bf9e7f
---
M tests/README.rst
M tests/__init__.py
2 files changed, 17 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/94/233194/1

diff --git a/tests/README.rst b/tests/README.rst
index 349bf63..3e2dc35 100644
--- a/tests/README.rst
+++ b/tests/README.rst
@@ -30,6 +30,11 @@
 
     python setup.py test
 
+::
+
+    python setup.py nosetests --tests tests
+
+
 Module unittest
 ~~~~~~~~~~~~~~~
 
@@ -70,6 +75,13 @@
 
     python pwb.py tests/site_tests.py -v
 
+env
+~~~
+
+::
+
+    PYWIKIBOT_TEST_MODULES=site python setup.py test
+
 
 Travis CI
 =========
diff --git a/tests/__init__.py b/tests/__init__.py
index 704920d..ff51b9b 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -130,6 +130,10 @@
 
 test_modules = library_test_modules + extra_test_modules + script_test_modules
 
+if 'PYWIKIBOT_TEST_MODULES' in os.environ:
+    _enabled_test_modules = os.environ['PYWIKIBOT_TEST_MODULES'].split(',')
+    disabled_test_modules = set(test_modules) - set(_enabled_test_modules)
+
 
 def collector(loader=unittest.loader.defaultTestLoader):
     """Load the default modules.
@@ -152,9 +156,7 @@
               % disabled_tests)
 
     modules = [module
-               for module in (library_test_modules +
-                              extra_test_modules +
-                              script_test_modules)
+               for module in test_modules
                if module not in disabled_test_modules]
 
     test_list = []

-- 
To view, visit https://gerrit.wikimedia.org/r/233194
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I342c012235c260717cf29e847dc9634988bf9e7f
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to