Xqt created this task.
Xqt added projects: Pywikibot-tests, good first task.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.
Restricted Application added a project: Pywikibot.

TASK DESCRIPTION
  What to change?
  ---------------
  
  All occurences of
  
  - assertRaises
  - assertRaisesRegex
  - assertWarns
  - assertWarnsRegex
  
  The can be  found here 
<https://codesearch.wmcloud.org/pywikibot/?q=assert(Raises%7CWarns)(Regexp%3F)%3F&i=nope&files=&repos=>.
  
  Why to change?
  --------------
  
  These Unittest method where changed from partial call to context manager with 
the benefit of better readability and a new `msg` parameter is provided with it
  
  How to change?
  --------------
  
  replace code like
  
    self.assertRaisesRegex(ValueError, "invalid literal for.*XYZ'$", int, 'XYZ')
  
  with
  
    with self.assertRaisesRegex(ValueError, "invalid literal for.*XYZ'$"):
       int('XYZ')
  
  
  
  Documentation
  -------------
  
  
https://docs.python.org/3/library/unittest.html?highlight=assertraisesregex#unittest.TestCase.assertRaises

TASK DETAIL
  https://phabricator.wikimedia.org/T267801

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Xqt
Cc: Aklapper, Xqt, pywikibot-bugs-list, Annysah01, Rohitgeddam, JohnsonLee01, 
SHEKH, Dijkstra, Khutuck, Soda, Chaytanya, Zkhalido, wiki-helenatxu, Viztor, 
Wenyi, Kieubinhtb, Tks4Fish, Mh-3110, Asad_Ali_Palijo, Lahi, Soteriaspace, 
JakeTheDeveloper, Tbscho, MayS, Mdupont, JJMC89, Dvorapa, xSavitar, 
Altostratus, Avicennasis, MuhammadShuaib, Tmalhotra, SimmeD, mys_721tx, jayvdb, 
Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to