https://travis-ci.org/wikimedia/pywikibot/jobs/640945627#L1238
______________ TestGenerateFamilyFiles.test_attributes_after_run _______________ self = <tests.generate_family_file_tests.TestGenerateFamilyFiles testMethod=test_attributes_after_run> def test_attributes_after_run(self): """Test FamilyFileGenerator attributes after run().""" gen = self.generator_instance gen.run() with self.subTest(test='Test whether default is loaded'): self.assertIn(self.site.lang, gen.wikis) with self.subTest(test='Test element counts'): if self.site.lang not in gen.prefixes: gen.prefixes += [self.site.lang] > self.assertCountEqual(gen.prefixes, gen.wikis) E AssertionError: Element counts were not equal: E First has 1, Second has 0: 'es' E First has 1, Second has 0: 'ja' E First has 1, Second has 0: 'sv' E First has 1, Second has 0: 'sr' E First has 1, Second has 0: 'zh' E First has 1, Second has 0: 'eo' E First has 1, Second has 0: 'uk' E First has 1, Second has 0: 'nl' E First has 1, Second has 0: 'ar' tests/generate_family_file_tests.py:74: AssertionError ------------------------------ Captured log call ------------------------------- logging.py 109 VERBOSE https://en.wikisource.beta.wmflabs.org redirected to https://en.wikisource.beta.wmflabs.org/wiki/Main_Page logging.py 109 VERBOSE wgEnableApi is not enabled in HTML of https://en.wikisource.beta.wmflabs.org/wiki/Main_Page logging.py 109 VERBOSE MW pre-1.17 detection failed: AttributeError("'NoneType' object has no attribute 'groups'",) logging.py 109 WARNING Http response status 404 logging.py 109 VERBOSE wgEnableApi is not enabled in HTML of https://es.wikisource.beta.wmflabs.org/wiki/ logging.py 109 VERBOSE MW pre-1.17 detection failed: AttributeError("'NoneType' object has no attribute 'groups'",) logging.py 109 WARNING Http response status 404 logging.py 109 VERBOSE wgEnableApi is not enabled in HTML of https://ja.wikisource.beta.wmflabs.org/wiki/ logging.py 109 VERBOSE MW pre-1.17 detection failed: AttributeError("'NoneType' object has no attribute 'groups'",) logging.py 109 WARNING Http response status 404 logging.py 109 VERBOSE wgEnableApi is not enabled in HTML of https://sv.wikisource.beta.wmflabs.org/wiki/ logging.py 109 VERBOSE MW pre-1.17 detection failed: AttributeError("'NoneType' object has no attribute 'groups'",) logging.py 109 WARNING Http response status 404 logging.py 109 VERBOSE wgEnableApi is not enabled in HTML of https://sr.wikisource.beta.wmflabs.org/wiki/ logging.py 109 VERBOSE MW pre-1.17 detection failed: AttributeError("'NoneType' object has no attribute 'groups'",) logging.py 109 WARNING Http response status 404 logging.py 109 VERBOSE wgEnableApi is not enabled in HTML of https://zh.wikisource.beta.wmflabs.org/wiki/ logging.py 109 VERBOSE MW pre-1.17 detection failed: AttributeError("'NoneType' object has no attribute 'groups'",) logging.py 109 WARNING Http response status 404 logging.py 109 VERBOSE wgEnableApi is not enabled in HTML of https://eo.wikisource.beta.wmflabs.org/wiki/ logging.py 109 VERBOSE MW pre-1.17 detection failed: AttributeError("'NoneType' object has no attribute 'groups'",) logging.py 109 WARNING Http response status 404 logging.py 109 VERBOSE wgEnableApi is not enabled in HTML of https://uk.wikisource.beta.wmflabs.org/wiki/ logging.py 109 VERBOSE MW pre-1.17 detection failed: AttributeError("'NoneType' object has no attribute 'groups'",) logging.py 109 WARNING Http response status 404 logging.py 109 VERBOSE wgEnableApi is not enabled in HTML of https://nl.wikisource.beta.wmflabs.org/wiki/ logging.py 109 VERBOSE MW pre-1.17 detection failed: AttributeError("'NoneType' object has no attribute 'groups'",) logging.py 109 WARNING Http response status 404 logging.py 109 VERBOSE wgEnableApi is not enabled in HTML of https://ar.wikisource.beta.wmflabs.org/wiki/ logging.py 109 VERBOSE MW pre-1.17 detection failed: AttributeError("'NoneType' object has no attribute 'groups'",)
https://travis-ci.org/wikimedia/pywikibot/jobs/640945628#L1168
______________ TestGenerateFamilyFiles.test_attributes_after_run _______________ self = <tests.generate_family_file_tests.TestGenerateFamilyFiles testMethod=test_attributes_after_run> def test_attributes_after_run(self): """Test FamilyFileGenerator attributes after run().""" gen = self.generator_instance > gen.run() tests/generate_family_file_tests.py:66: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ generate_family_file.py:63: in run self.getapis() tests/generate_family_file_tests.py:32: in getapis self.langs = sample(save, 10) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <random.Random object at 0x11a3b58> population = [{'language': 'Аҧсшәа', 'local': '', 'prefix': 'ab', 'url': 'https://acousticbrainz.org/$1'}, {'language': 'Lëtzebuerg...tps://listenbrainz.org/$1'}, {'language': 'en', 'local': '', 'prefix': 'en', 'url': 'https://wiki.musicbrainz.org/$1'}] k = 10 def sample(self, population, k): """Chooses k unique random elements from a population sequence or set. Returns a new list containing elements from the population while leaving the original population unchanged. The resulting list is in selection order so that all sub-slices will also be valid random samples. This allows raffle winners (the sample) to be partitioned into grand prize and second place winners (the subslices). Members of the population need not be hashable or unique. If the population contains repeats, then each occurrence is a possible selection in the sample. To choose a sample in a range of integers, use range as an argument. This is especially fast and space efficient for sampling from a large population: sample(range(10000000), 60) """ # Sampling without replacement entails tracking either potential # selections (the pool) in a list or previous selections in a set. # When the number of selections is small compared to the # population, then tracking selections is efficient, requiring # only a small set and an occasional reselection. For # a larger number of selections, the pool tracking method is # preferred since the list takes less space than the # set and it doesn't suffer from frequent reselections. if isinstance(population, _Set): population = tuple(population) if not isinstance(population, _Sequence): raise TypeError("Population must be a sequence or set. For dicts, use list(d).") randbelow = self._randbelow n = len(population) if not 0 <= k <= n: > raise ValueError("Sample larger than population") E ValueError: Sample larger than population ../../../virtualenv/python3.5.6/lib/python3.5/random.py:324: ValueError ------------------------------ Captured log call ------------------------------- logging.py 109 VERBOSE https://wiki.musicbrainz.org redirected to https://wiki.musicbrainz.org/Main_Page logging.py 109 VERBOSE wgEnableApi is not enabled in HTML of https://wiki.musicbrainz.org/Main_Page logging.py 109 VERBOSE MW pre-1.17 detection failed: AttributeError("'NoneType' object has no attribute 'groups'",)