Skip to content

Commit f1be224

Browse files
authored
Docker: Make warning test insensitive to deprecation warnings (#6541)
The Docker image is supposed to configure the profile such that warnings about using a development version of `aiida-core` and a modern version of RabbitMQ are silenced. The test was checking that `Warning` did not appear in the output of `verdi status`, however, this would result in false positives in case a deprecation warning would be printed due to downstream dependencies that we cannot necessarily control. The test is made more specific to check for a line starting with `Warning:` which should reduce the chance for false positives.
1 parent 16b8fe4 commit f1be224

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.docker/tests/test_aiida.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import json
2+
import re
23

34
import pytest
45
from packaging.version import parse
@@ -32,8 +33,10 @@ def test_verdi_status(aiida_exec, container_user):
3233
assert '✔ broker:' in output
3334
assert 'Daemon is running' in output
3435

35-
# check that we have suppressed the warnings
36-
assert 'Warning' not in output
36+
# Check that we have suppressed the warnings coming from using an install from repo and newer RabbitMQ version.
37+
# Make sure to match only lines that start with ``Warning:`` because otherwise deprecation warnings from other
38+
# packages that we cannot control may fail the test.
39+
assert not re.match('^Warning:.*', output)
3740

3841

3942
def test_computer_setup_success(aiida_exec, container_user):

0 commit comments

Comments
 (0)