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

test_from_dict_bad_private_key breaks with cryptography 45.0.1 #1763

@mweinelt

Description

@mweinelt

With cryptography>45 the following test breaks:

google-auth> ________________________ test_from_dict_bad_private_key ________________________
google-auth> 
google-auth>     def test_from_dict_bad_private_key():
google-auth>         info = SERVICE_ACCOUNT_INFO.copy()
google-auth>         info["private_key"] = "garbage"
google-auth>     
google-auth>         with pytest.raises(ValueError) as excinfo:
google-auth>             _service_account_info.from_dict(info)
google-auth>     
google-auth> >       assert excinfo.match(r"key")
google-auth> E       AssertionError: Regex pattern did not match.
google-auth> E        Regex: 'key'
google-auth> E        Input: 'Unable to load PEM file. See https://cryptography.io/en/latest/faq/#why-can-t-i-import-my-pem-file for more details. MalformedFraming'
google-auth> 
google-auth> tests/test__service_account_info.py:56: AssertionError

https://cryptography.io/en/latest/faq/#why-can-t-i-import-my-pem-file

Environment details

  • OS: Linux (NixOS Unstable)
  • Python version: 3.13
  • pip version: n/a
  • google-auth version: 2.40.1

Steps to reproduce

  1. Update cryptography to 45.0.1
  2. Run the test suite

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions