xmitgcm icon indicating copy to clipboard operation
xmitgcm copied to clipboard

pytest deprecation error

Open rabernat opened this issue 6 years ago • 1 comments

Tests are failing on python 3.6 with a pytest deprectation problem, involving the use of the message keyword

 pytest.PytestDeprecationWarning: The 'message' parameter is deprecated.
(did you mean to use `match='some regex'` to check the exception message?)
Please see: https://docs.pytest.org/en/4.6-maintenance/deprecations.html#message-parameter-of-pytest-raises

rabernat avatar Jul 11 '19 13:07 rabernat

It should be an easy fix. From pytest docs: For example:

with pytest.raises(TimeoutError, message="Client got unexpected message"):
    wait_for(websocket.recv(), 0.5)

Becomes:

with pytest.raises(TimeoutError):
    wait_for(websocket.recv(), 0.5)
    pytest.fail("Client got unexpected message")

malmans2 avatar Aug 05 '19 15:08 malmans2