Skip to content

Commit

Permalink
Work around another ResourceWarning in unit tests
Browse files Browse the repository at this point in the history
Python 3.11+ changed the warning for an unclosed transport when the
event loop is closed.
  • Loading branch information
bmerry committed Apr 16, 2024
1 parent fc97774 commit 31f87dd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,8 @@ def callback(reader, writer):
server.close()
await server.wait_closed()

@pytest.mark.filterwarnings("ignore:unclosed transport")
@pytest.mark.filterwarnings("ignore:unclosed transport:ResourceWarning")
@pytest.mark.filterwarnings("ignore:loop is closed:ResourceWarning")
def test(self) -> None:
loop = async_solipsism.EventLoop()
with pytest.warns(ResourceWarning, match="unclosed Client"):
Expand Down

0 comments on commit 31f87dd

Please sign in to comment.