Skip to content

Fix: Restore test collection for credentials and mock tests #1724

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.py text eol=lf
33 changes: 33 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Python CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: [3.8, 3.9, 3.10, 3.11]

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python $\{{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: $\{{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[tests]

- name: Run tests
run: |
pytest -v tests/
2 changes: 2 additions & 0 deletions google/auth/external_account_authorized_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,3 +378,5 @@ def from_file(cls, filename, **kwargs):
with io.open(filename, "r", encoding="utf-8") as json_file:
data = json.load(json_file)
return cls.from_info(data, **kwargs)


2 changes: 2 additions & 0 deletions tests/oauth2/test_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -1066,3 +1066,5 @@ def test_before_request(self, refresh, apply):
cred.before_request(mock.Mock(), "GET", "https://example.com", {})
refresh.assert_called()
apply.assert_called()


2 changes: 2 additions & 0 deletions tests/test_external_account_authorized_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,3 +557,5 @@ def test_from_file_full_options(self, tmpdir):
assert creds.scopes == SCOPES
assert creds._revoke_url == REVOKE_URL
assert creds._quota_project_id == QUOTA_PROJECT_ID