13
14import pywikibot
15from pywikibot.data import api
16from pywikibot.exceptions import ( 17 APIError,
18 Error,
19 HiddenKeyError,
16import pywikibot
17import pywikibot.page
18from pywikibot import config
19from pywikibot.exceptions import ( 20 Error,
21 InvalidTitleError,
22 IsNotRedirectPageError,
10import unittest
11from contextlib import contextmanager, suppress
12
13from pywikibot.exceptions import LockedPageError, TimeoutError 14from pywikibot.flow import Board, Post, Topic
15from tests.aspects import TestCase
16from tests.utils import skipping
265 @patch('pywikibot.info')
266 @patch('pywikibot.userinterfaces.buffer_interface.UI.input',
267 return_value='q')
268 def test_by_letter_quit(self, input, mock):269 """Check cherry_pick output.
270
271 If by_letter diff is enabled and quit during review.
252 @patch('pywikibot.info')
253 @patch('pywikibot.userinterfaces.buffer_interface.UI.input',
254 return_value='y')
255 def test_by_letter_accept(self, input, mock):256 """Check cherry_pick output.
257
258 If by_letter diff is enabled and changes accepted.
Defining a local variable or function with the same name as a built-in object makes the built-in object unusable within the current scope and makes the code prone to bugs.
dict = {} # dict is a Python builtin!
for idx, student in enumerate(students):
dict[student] = idx
roll_number = {}
for idx, student in enumerate(students):
roll_number[student] = idx