1288 # hasattr() loads the attributes; use item.__dict__ for tests
1289 self.assertNotIn(attr, item.__dict__)
1290
1291 item.labels # trigger loading1292 for attr in attrs:
1293 with self.subTest(attr=attr, note='after loading'):
1294 self.assertIn(attr, item.__dict__)
356 page = ProofreadPage(self.site, 'Page:dummy test page')
357 # Fetch page text to instantiate page._full_header, in order to allow
358 # for proper test result preparation.
359 page.text360 class_pagetext, div = self.class_pagetext_fmt[
361 page._full_header._has_div]
362 self.assertEqual(page.text,
151 """Test wrong interwiki prefix."""
152 for prefix in ('foo', 'mediawiki', 'test'):
153 with self.subTest(prefix=prefix), self.assertRaises(KeyError):
154 self.iw_map[prefix]155
156
157if __name__ == '__main__':
78 site = self.get_site('dews')
79 iw_map = site._interwikimap
80 self.assertIsNone(iw_map._map)
81 iw_map._iw_sites # load data 82 self.assertIsInstance(iw_map._map, dict)
83 for entry in iw_map._map.values():
84 with self.subTest(url=entry.url):
The expression or statement is pointless and will not affect the program's execution. It should be removed.
It is recommended to remove the statement as it adds unnecessary complexity to the codebase.
x = input()
x == 3 # Line doesn't do anything, it can be safely removed
calculate_res(x)
x = input()
calculate_res(x)