From 8782ae7bb563421f27e0901be2473f848aee62c4 Mon Sep 17 00:00:00 2001 From: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com> Date: Mon, 19 May 2025 20:58:14 +0200 Subject: [PATCH] Fix a Failing Test Case (#4793) --- changes/unreleased/4793.mDR5p3mrSmPFQkvWFGWBmD.toml | 5 +++++ tests/_passport/test_passport.py | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 changes/unreleased/4793.mDR5p3mrSmPFQkvWFGWBmD.toml diff --git a/changes/unreleased/4793.mDR5p3mrSmPFQkvWFGWBmD.toml b/changes/unreleased/4793.mDR5p3mrSmPFQkvWFGWBmD.toml new file mode 100644 index 000000000..7a6ca4c3e --- /dev/null +++ b/changes/unreleased/4793.mDR5p3mrSmPFQkvWFGWBmD.toml @@ -0,0 +1,5 @@ +internal = "Fix a Failing Test Case" +[[pull_requests]] +uid = "4793" +author_uid = "Bibo-Joshi" +closes_threads = [] diff --git a/tests/_passport/test_passport.py b/tests/_passport/test_passport.py index 8f5776fd8..4104a2c6b 100644 --- a/tests/_passport/test_passport.py +++ b/tests/_passport/test_passport.py @@ -418,7 +418,10 @@ class TestPassportWithoutRequest(PassportTestBase): with pytest.raises(TypeError): Bot(offline_bot.token, private_key="Invalid key!") - with pytest.raises(ValueError, match="Could not deserialize key data"): + # Different error messages for different cryptography versions + with pytest.raises( + ValueError, match="(Could not deserialize key data)|(Unable to load PEM file)" + ): Bot(offline_bot.token, private_key=b"Invalid key!") def test_all_types(self, passport_data, offline_bot, all_passport_data):