Skip to content

Commit 428c31c

Browse files
authored
Merge pull request #200 from certbot/silence-warning
Filter warning caused by deprecated pyopenssl usage of datetime
2 parents c4992ad + 5c7aadf commit 428c31c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/util_test.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import functools
44
import sys
55
import unittest
6+
import warnings
67

78
import pytest
89
import test_util
@@ -22,7 +23,13 @@ def setUp(self) -> None:
2223
self.cert_other = test_util.load_comparable_cert("cert-san.pem")
2324

2425
def test_getattr_proxy(self) -> None:
25-
assert self.cert1.has_expired() is True
26+
with warnings.catch_warnings():
27+
warnings.filterwarnings(
28+
"ignore",
29+
category=DeprecationWarning,
30+
message=".*Use timezone-aware objects to represent datetimes",
31+
)
32+
assert self.cert1.has_expired() is True
2633

2734
def test_eq(self) -> None:
2835
assert self.req1 == self.req2

0 commit comments

Comments
 (0)