Skip to content

Commit

Permalink
Fix tests for Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
Elena Grandi committed Jan 10, 2024
1 parent b3e3a2c commit 6aaf9d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# New in version UNRELEASED

* Fix tests for Python 3.12

New in version 0.1.7

* Allow ranges of decimal digits in some fields, to match specifications more
Expand Down
4 changes: 2 additions & 2 deletions tests/test_p7m.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ def test_verify_corrupted_payload(self):
encap_content_info["content"] = b"All your base are belong to us"
p7m.data = p7m.content_info.dump()
with self.capath() as capath:
with self.assertRaisesRegexp(InvalidSignatureError, r"routines:CMS_verify:content verify error"):
with self.assertRaisesRegex(InvalidSignatureError, r"routines:CMS_verify:content verify error"):
p7m.verify_signature(capath)

def test_verify_noca(self):
p7m = P7M("tests/data/test.txt.p7m")
if p7m.is_expired():
self.skipTest("test signature has expired and needs to be regenerated")
with tempfile.TemporaryDirectory() as capath:
with self.assertRaisesRegexp(
with self.assertRaisesRegex(
InvalidSignatureError, r"Verify error:\s*unable to get local issuer certificate"):
p7m.verify_signature(capath)

0 comments on commit 6aaf9d6

Please sign in to comment.