GothenburgBitFactory / bugwarrior

Pull github, bitbucket, and trac issues into taskwarrior
http://pypi.python.org/pypi/bugwarrior
GNU General Public License v3.0
740 stars 209 forks source link

On Running tests: test_get_credentials_with_refresh #858

Closed StephanMeijer closed 2 years ago

StephanMeijer commented 2 years ago
$ python3 -mpytest --cov=bugwarrior --cov-branch tests
================================================================================================================ test session starts =================================================================================================================
platform linux -- Python 3.7.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /home/steve/Projects/StephanMeijer/bugwarrior
plugins: cov-3.0.0
collected 148 items / 1 skipped / 147 selected                                                                                                                                                                                                       

tests/test_activecollab.py ..                                                                                                                                                                                                                  [  1%]
tests/test_activecollab2.py ..                                                                                                                                                                                                                 [  2%]
tests/test_bitbucket.py s....                                                                                                                                                                                                                  [  6%]
tests/test_bts.py ..                                                                                                                                                                                                                           [  7%]
tests/test_bugzilla.py ......                                                                                                                                                                                                                  [ 11%]
tests/test_config.py ............................                                                                                                                                                                                              [ 30%]
tests/test_data.py ...                                                                                                                                                                                                                         [ 32%]
tests/test_db.py .......                                                                                                                                                                                                                       [ 37%]
tests/test_gerrit.py ..                                                                                                                                                                                                                        [ 38%]
tests/test_github.py ................                                                                                                                                                                                                          [ 49%]
tests/test_gitlab.py .............                                                                                                                                                                                                             [ 58%]
tests/test_gmail.py .F....                                                                                                                                                                                                                     [ 62%]
tests/test_jira.py ....                                                                                                                                                                                                                        [ 64%]
tests/test_phab.py s.                                                                                                                                                                                                                          [ 66%]
tests/test_pivotaltracker.py ........                                                                                                                                                                                                          [ 71%]
tests/test_redmine.py ..                                                                                                                                                                                                                       [ 72%]
tests/test_service.py ......                                                                                                                                                                                                                   [ 77%]
tests/test_string_compat.py .                                                                                                                                                                                                                  [ 77%]
tests/test_taiga.py ..                                                                                                                                                                                                                         [ 79%]
tests/test_teamlab.py ..                                                                                                                                                                                                                       [ 80%]
tests/test_teamwork_projects.py ..                                                                                                                                                                                                             [ 81%]
tests/test_templates.py ....                                                                                                                                                                                                                   [ 84%]
tests/test_trac.py ..                                                                                                                                                                                                                          [ 85%]
tests/test_trello.py ..................                                                                                                                                                                                                        [ 97%]
tests/test_youtrak.py ...                                                                                                                                                                                                                      [100%]

====================================================================================================================== FAILURES ======================================================================================================================
_________________________________________________________________________________________________ TestGmailService.test_get_credentials_with_refresh _________________________________________________________________________________________________

self = <tests.test_gmail.TestGmailService testMethod=test_get_credentials_with_refresh>

    def test_get_credentials_with_refresh(self):
        mock_api = mock.Mock()
        gmail.GmailService.build_api = mock_api
        service = GmailService(self.config, "general", "myservice")

        expired_credential = Credentials(**copy(TEST_CREDENTIAL))
        expired_credential.expiry = datetime.now()
>       self.assertEqual(expired_credential.valid, False)
E       AssertionError: True != False

tests/test_gmail.py:61: AssertionError
================================================================================================================== warnings summary ==================================================================================================================
../../../.asdf/installs/python/3.7.12/lib/python3.7/site-packages/future-0.18.2-py3.7.egg/future/standard_library/__init__.py:65
  /home/steve/.asdf/installs/python/3.7.12/lib/python3.7/site-packages/future-0.18.2-py3.7.egg/future/standard_library/__init__.py:65: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
    import imp

../../../.asdf/installs/python/3.7.12/lib/python3.7/site-packages/pysimplesoap/transport.py:107
  /home/steve/.asdf/installs/python/3.7.12/lib/python3.7/site-packages/pysimplesoap/transport.py:107: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
    if 'timeout' in inspect.getargspec(httplib2.Http.__init__)[0]:

tests/test_templates.py::TestTemplates::test_override_project
  <template>:14: DeprecationWarning: 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.

tests/test_youtrak.py::TestYoutrackIssue::test_issues
tests/test_youtrak.py::TestYoutrackIssue::test_issues
tests/test_youtrak.py::TestYoutrackIssue::test_to_taskwarrior
tests/test_youtrak.py::TestYoutrackIssue::test_to_taskwarrior
  <template>:13: DeprecationWarning: 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.

-- Docs: https://docs.pytest.org/en/stable/warnings.html

---------- coverage: platform linux, python 3.7.12-final-0 -----------
Name                                       Stmts   Miss Branch BrPart  Cover
----------------------------------------------------------------------------
bugwarrior/__init__.py                         2      0      0      0   100%
bugwarrior/command.py                         93     62     24      0    26%
bugwarrior/config.py                         164     62     66      7    58%
bugwarrior/data.py                            27      0      2      0   100%
bugwarrior/db.py                             235     44    134     27    78%
bugwarrior/notifications.py                   68     55     32      0    13%
bugwarrior/services/__init__.py              281     92    102     17    64%
bugwarrior/services/activecollab2.py          90      7     30      6    84%
bugwarrior/services/activecollab.py          114     23     48     13    72%
bugwarrior/services/bitbucket.py             132     20     60      9    79%
bugwarrior/services/bts.py                    91     23     50      8    64%
bugwarrior/services/bz.py                    137     36     64     14    67%
bugwarrior/services/gerrit.py                 68      7     20      4    83%
bugwarrior/services/github.py                243     31     92     13    80%
bugwarrior/services/gitlab.py                294     87    108     23    62%
bugwarrior/services/gmail.py                 118     11     28      5    88%
bugwarrior/services/jira.py                  176     29     59     12    77%
bugwarrior/services/mplan.py                  54     52     12      0     3%
bugwarrior/services/pagure.py                114    114     42      0     0%
bugwarrior/services/phab.py                  120     82     68      6    26%
bugwarrior/services/pivotaltracker.py        151      9     44     11    90%
bugwarrior/services/redmine.py               123     18     38     14    78%
bugwarrior/services/taiga.py                  71     10     22      3    77%
bugwarrior/services/teamlab.py                72      8     18      3    83%
bugwarrior/services/teamwork_projects.py      90      3     26      9    90%
bugwarrior/services/trac.py                   98     24     34      7    67%
bugwarrior/services/trello.py                 96      0     41      3    98%
bugwarrior/services/versionone.py             81     81     20      0     0%
bugwarrior/services/youtrack.py              103     16     30      8    77%
----------------------------------------------------------------------------
TOTAL                                       3506   1006   1314    222    66%

============================================================================================================== short test summary info ===============================================================================================================
FAILED tests/test_gmail.py::TestGmailService::test_get_credentials_with_refresh - AssertionError: True != False
================================================================================================ 1 failed, 145 passed, 3 skipped, 7 warnings in 1.72s ================================================================================================
ryneeverett commented 2 years ago

Resolved via #859.