John Vandenberg has uploaded a new change for review.

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

Change subject: Mark additional tests as unconnected to a Site
......................................................................

Mark additional tests as unconnected to a Site

* Namespace tests do not need a site.
* One of the textlib tests does not need a site.
* One of the wikidataquery tests talks to wikidataquery
  but does not need a site.

Change-Id: Iffacec799d421a678c45ea82e1e32abf400e34fd
---
M tests/namespace_tests.py
M tests/textlib_tests.py
M tests/wikidataquery_tests.py
3 files changed, 8 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/92/154392/1

diff --git a/tests/namespace_tests.py b/tests/namespace_tests.py
index b6fe44f..70ff073 100644
--- a/tests/namespace_tests.py
+++ b/tests/namespace_tests.py
@@ -11,14 +11,14 @@
 
 from collections import Iterable
 from pywikibot.site import Namespace
-from tests.utils import PywikibotTestCase, unittest
+from tests.utils import NoSiteTestCase, unittest
 
 import sys
 if sys.version_info[0] > 2:
     basestring = (str, )
 
 
-class TestNamespaceObject(PywikibotTestCase):
+class TestNamespaceObject(NoSiteTestCase):
     """Test cases for Namespace class."""
 
     # These should work in any MW wiki
diff --git a/tests/textlib_tests.py b/tests/textlib_tests.py
index edcead9..b57d979 100644
--- a/tests/textlib_tests.py
+++ b/tests/textlib_tests.py
@@ -17,7 +17,7 @@
 import pywikibot.textlib as textlib
 from pywikibot import config
 
-from tests.utils import unittest, PywikibotTestCase
+from tests.utils import unittest, NoSiteTestCase, PywikibotTestCase
 
 files = {}
 dirname = os.path.join(os.path.dirname(__file__), "pages")
@@ -27,9 +27,8 @@
                            'r', 'utf-8').read()
 
 
-class TestSectionFunctions(PywikibotTestCase):
+class TestSectionFunctions(NoSiteTestCase):
     def setUp(self):
-        self.site = pywikibot.Site('en', 'wikipedia')
         self.catresult1 = ('[[Category:Cat1]]%(LS)s[[Category:Cat2]]%(LS)s'
                            % {'LS': config.LS})
         super(TestSectionFunctions, self).setUp()
diff --git a/tests/wikidataquery_tests.py b/tests/wikidataquery_tests.py
index f1044b8..ae6a08f 100644
--- a/tests/wikidataquery_tests.py
+++ b/tests/wikidataquery_tests.py
@@ -12,7 +12,7 @@
 
 
 import pywikibot.data.wikidataquery as query
-from tests.utils import unittest, PywikibotTestCase
+from tests.utils import unittest, NoSiteTestCase, PywikibotTestCase
 
 import pywikibot
 from pywikibot.page import ItemPage, PropertyPage, Claim
@@ -228,7 +228,9 @@
         self.assertEqual(qs, "q=link%5Benwiki%5D&labels=en,fr&props=prop")
 
 
-class TestApiSlowFunctions(PywikibotTestCase):
+class TestApiSlowFunctions(NoSiteTestCase):
+
+    net = True
 
     def testQueryApiGetter(self):
         """

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iffacec799d421a678c45ea82e1e32abf400e34fd
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to