In CI, it would probably be good hygiene to promote warnings to errors (if the intention is that tests should never warn).
This could be done quite easily with
diff --git a/pyproject.toml b/pyproject.toml
index d2e5adff..4e11d3aa 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -116,6 +116,7 @@ source = [".", "/tmp"]
addopts = "--ignore=v0"
# These suppress only test output; runtime warnings still reach users.
filterwarnings = [
+ "error",
# Raised by PyTorch (via gpytorch) - not actionable here.
# Remove if dependencies no longer calling `torch.jit.script`.
"ignore:`torch\\.jit\\.script` is deprecated\\..*:DeprecationWarning",
There is one problem, though, which is that we can't actually suppress this warning, which is still seen in CI logs
.venv/lib/python3.10/site-packages/pyro/ops/stats.py:514
/home/runner/work/autoemulate/autoemulate/.venv/lib/python3.10/site-packages/pyro/ops/stats.py:514: DeprecationWarning: invalid escape sequence '\g'
"""
In #1000 a filter was added to suppress this, but it doesn't seem to actually suppress it. I think this is because it happens at the point where pyro is imported, which is before pytest has even loaded. This tallies with some pytest issues, most notably pytest-dev/pytest#13145.
The suggested workaround is to launch Python itself with a -Wignore... flag so that the warning is suppressed at the highest level. I've tested locally and can confirm that this works.
In CI, it would probably be good hygiene to promote warnings to errors (if the intention is that tests should never warn).
This could be done quite easily with
There is one problem, though, which is that we can't actually suppress this warning, which is still seen in CI logs
In #1000 a filter was added to suppress this, but it doesn't seem to actually suppress it. I think this is because it happens at the point where pyro is imported, which is before pytest has even loaded. This tallies with some pytest issues, most notably pytest-dev/pytest#13145.
The suggested workaround is to launch Python itself with a
-Wignore...flag so that the warning is suppressed at the highest level. I've tested locally and can confirm that this works.