_get_page_mappings is doing a purge, which is a write operation. That means these tests are writing to the wiki without the class being marked write = True.
Can the purge be avoided, so that these test methods always run?
An alternative approach is to create a new special value for the write flag which indicates that the test uses the purge operation, which is a special kind of write operation because it doesnt create a edit/log entry.
====================================================================== ERROR: test_check_if_cached_enws (tests.proofreadpage_tests.TestIndexPageMappings) Test if cache is checked and loaded properly on wikisource:en ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/aspects.py", line 688, in wrapped_method func(self, key) File "tests/proofreadpage_tests.py", line 456, in test_check_if_cached fetched_label = index_page.get_label_from_page_number(num) File "pywikibot/proofreadpage.py", line 471, in wrapper self._get_page_mappings() File "pywikibot/proofreadpage.py", line 514, in _get_page_mappings self.purge() File "pywikibot/page.py", line 1299, in purge return self.site.purgepages([self], **kwargs) File "pywikibot/site.py", line 1304, in callee return fn(self, *args, **kwargs) File "pywikibot/site.py", line 5465, in purgepages titles=[page for page in set(pages)]) File "pywikibot/site.py", line 1959, in _simple_request site=self, **kwargs) File "tests/__init__.py", line 285, in create_simple return cls(site=site, parameters=kwargs) File "tests/__init__.py", line 279, in __init__ super(TestRequest, self).__init__(0, *args, **kwargs) File "pywikibot/data/api.py", line 2205, in __init__ super(CachedRequest, self).__init__(*args, **kwargs) File "pywikibot/data/api.py", line 1452, in __init__ % self.site._userinfo['name']) Error: API write action attempted as IP u'xxx.xxx.xxx.xxx' ====================================================================== ERROR: test_get_labels_enws (tests.proofreadpage_tests.TestIndexPageMappings) Test IndexPage page get_label_from_* functions on wikisource:en ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/aspects.py", line 688, in wrapped_method func(self, key) File "tests/proofreadpage_tests.py", line 483, in test_get_labels self.assertEqual(index_page.get_label_from_page_number(num), label) File "pywikibot/proofreadpage.py", line 471, in wrapper self._get_page_mappings() File "pywikibot/proofreadpage.py", line 514, in _get_page_mappings self.purge() File "pywikibot/page.py", line 1299, in purge return self.site.purgepages([self], **kwargs) File "pywikibot/site.py", line 1304, in callee return fn(self, *args, **kwargs) File "pywikibot/site.py", line 5465, in purgepages titles=[page for page in set(pages)]) File "pywikibot/site.py", line 1959, in _simple_request site=self, **kwargs) File "tests/__init__.py", line 285, in create_simple return cls(site=site, parameters=kwargs) File "tests/__init__.py", line 279, in __init__ super(TestRequest, self).__init__(0, *args, **kwargs) File "pywikibot/data/api.py", line 2205, in __init__ super(CachedRequest, self).__init__(*args, **kwargs) File "pywikibot/data/api.py", line 1452, in __init__ % self.site._userinfo['name']) Error: API write action attempted as IP u'xxx.xxx.xxx.xxx' ====================================================================== ERROR: test_get_page_and_number_enws (tests.proofreadpage_tests.TestIndexPageMappings) Test IndexPage page get_page_number functions on wikisource:en ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/aspects.py", line 688, in wrapped_method func(self, key) File "tests/proofreadpage_tests.py", line 500, in test_get_page_and_number self.assertEqual(index_page.get_page_number_from_label(label), File "pywikibot/proofreadpage.py", line 471, in wrapper self._get_page_mappings() File "pywikibot/proofreadpage.py", line 514, in _get_page_mappings self.purge() File "pywikibot/page.py", line 1299, in purge return self.site.purgepages([self], **kwargs) File "pywikibot/site.py", line 1304, in callee return fn(self, *args, **kwargs) File "pywikibot/site.py", line 5465, in purgepages titles=[page for page in set(pages)]) File "pywikibot/site.py", line 1959, in _simple_request site=self, **kwargs) File "tests/__init__.py", line 285, in create_simple return cls(site=site, parameters=kwargs) File "tests/__init__.py", line 279, in __init__ super(TestRequest, self).__init__(0, *args, **kwargs) File "pywikibot/data/api.py", line 2205, in __init__ super(CachedRequest, self).__init__(*args, **kwargs) File "pywikibot/data/api.py", line 1452, in __init__ % self.site._userinfo['name']) Error: API write action attempted as IP u'xxx.xxx.xxx.xxx' ====================================================================== ERROR: test_num_pages_enws (tests.proofreadpage_tests.TestIndexPageMappings) Test num_pages property on wikisource:en ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/aspects.py", line 688, in wrapped_method func(self, key) File "tests/proofreadpage_tests.py", line 471, in test_num_pages self.assertEqual(index_page.num_pages, self.sites[key]['num_pages']) File "pywikibot/proofreadpage.py", line 471, in wrapper self._get_page_mappings() File "pywikibot/proofreadpage.py", line 514, in _get_page_mappings self.purge() File "pywikibot/page.py", line 1299, in purge return self.site.purgepages([self], **kwargs) File "pywikibot/site.py", line 1304, in callee return fn(self, *args, **kwargs) File "pywikibot/site.py", line 5465, in purgepages titles=[page for page in set(pages)]) File "pywikibot/site.py", line 1959, in _simple_request site=self, **kwargs) File "tests/__init__.py", line 285, in create_simple return cls(site=site, parameters=kwargs) File "tests/__init__.py", line 279, in __init__ super(TestRequest, self).__init__(0, *args, **kwargs) File "pywikibot/data/api.py", line 2205, in __init__ super(CachedRequest, self).__init__(*args, **kwargs) File "pywikibot/data/api.py", line 1452, in __init__ % self.site._userinfo['name']) Error: API write action attempted as IP u'xxx.xxx.xxx.xxx' ====================================================================== ERROR: test_page_gen_enws (tests.proofreadpage_tests.TestIndexPageMappings) Test Index page generator on wikisource:en ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/aspects.py", line 688, in wrapped_method func(self, key) File "tests/proofreadpage_tests.py", line 541, in test_page_gen self.assertRaises(ValueError, index_page.page_gen, -1, 2) File "/usr/lib64/python2.7/unittest/case.py", line 513, in assertRaises callableObj(*args, **kwargs) File "pywikibot/proofreadpage.py", line 613, in page_gen % (start, end, 1, self.num_pages)) File "pywikibot/proofreadpage.py", line 471, in wrapper self._get_page_mappings() File "pywikibot/proofreadpage.py", line 514, in _get_page_mappings self.purge() File "pywikibot/page.py", line 1299, in purge return self.site.purgepages([self], **kwargs) File "pywikibot/site.py", line 1304, in callee return fn(self, *args, **kwargs) File "pywikibot/site.py", line 5465, in purgepages titles=[page for page in set(pages)]) File "pywikibot/site.py", line 1959, in _simple_request site=self, **kwargs) File "tests/__init__.py", line 285, in create_simple return cls(site=site, parameters=kwargs) File "tests/__init__.py", line 279, in __init__ super(TestRequest, self).__init__(0, *args, **kwargs) File "pywikibot/data/api.py", line 2205, in __init__ super(CachedRequest, self).__init__(*args, **kwargs) File "pywikibot/data/api.py", line 1452, in __init__ % self.site._userinfo['name']) Error: API write action attempted as IP u'xxx.xxx.xxx.xxx'