Xqt added a comment.

  I think we should go another way with this test to make it more robust. 
Pywikibot has a `-dir` option to adjust the base dir but unfortunately it is 
not respected by the test:
  
    D:\pwb\GIT>py core/pwb.py -dir:core generate_user_files_tests.py
    tests: max_retries reduced from 15 to 1
    .......F..
    ======================================================================
    FAIL: test_file_exists (__main__.TestGenerateUserFiles.test_file_exists)
    Test file_exists function.
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "D:\pwb\GIT\core\tests\generate_user_files_tests.py", line 51, in 
test_file_exists
        self.assertTrue(guf.file_exists('pwb.py'))
    AssertionError: False is not true
    
    ----------------------------------------------------------------------
    Ran 10 tests in 0.010s
    
    FAILED (failures=1)
  
  Either the test should join the base dir like:
  
    self.assertTrue(guf.file_exists(os.path.join(pywikibot.config.base_dir, 
'pwb.py')))
  
  or `generate_user_files.file_exists()` should prepend it (instead of doing 
that in `ask_for_dir_change()` function several times.
  
  What do you think?

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

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

To: RoySmith, Xqt
Cc: Xqt, Aklapper, pywikibot-bugs-list, RoySmith, PotsdamLamb, Jyoo1011, 
JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, 
Mdupont, JJMC89, Dvorapa, Altostratus, binbot, Avicennasis, mys_721tx, jayvdb, 
Masti, Alchimista
_______________________________________________
pywikibot-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to