Skip to content
This repository was archived by the owner on Jun 8, 2026. It is now read-only.
This repository was archived by the owner on Jun 8, 2026. It is now read-only.

Unit test failing on master #123

Closed

Description

@larkee

There is a unit test failing on master:

___________________________ TestClient.test_constructor_implicit_credentials ____________________________

self = <tests.unit.test_client.TestClient testMethod=test_constructor_implicit_credentials>

    def test_constructor_implicit_credentials(self):
        creds = _make_credentials()
    
        patch = mock.patch("google.auth.default", return_value=(creds, None))
        with patch as default:
            self._constructor_test_helper(
                None, None, expected_creds=creds.with_scopes.return_value
            )
    
>       default.assert_called_once_with()

tests/unit/test_client.py:161: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.nox/unit-2-7/lib/python2.7/site-packages/mock/mock.py:957: in assert_called_once_with
    return self.assert_called_with(*args, **kwargs)
.nox/unit-2-7/lib/python2.7/site-packages/mock/mock.py:944: in assert_called_with
    six.raise_from(AssertionError(_error_message(cause)), cause)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

value = AssertionError("expected call not found.\nExpected: default()\nActual: default(scopes=('https://www.googleapis.com/auth/spanner.admin',))",)
from_value = None

    def raise_from(value, from_value):
>       raise value
E       AssertionError: expected call not found.
E       Expected: default()
E       Actual: default(scopes=('https://www.googleapis.com/auth/spanner.admin',))

.nox/unit-2-7/lib/python2.7/site-packages/six.py:738: AssertionError

This appears to be due to googleapis/python-cloud-core#15

Activity

  1. added
    api: spannerIssues related to the googleapis/python-spanner API.
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.
    on Aug 5, 2020
  2. self-assigned this
    on Aug 5, 2020
  3. tseaver commented on Aug 5, 2020

    @tseaver
    Contributor

    Caused by today's release of google-cloud-core 1.4.0, which now adds scopes by default. C.f. googleapis/python-datastore#53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: spannerIssues related to the googleapis/python-spanner API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions