Skip to content

Commit

Permalink
Merge pull request juju#954 from sed-i/patch-1
Browse files Browse the repository at this point in the history
juju#954

#### Description
Every integration test currently ends with a warning:
```
tests/integration/test_bundle.py::test_loki_receives_logs
 /home/ubuntu/code/o11y/cos-lite-bundle/.tox/integration/lib/python3.10/site-packages/juju/model.py:1513: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead
 log.warn("relate is deprecated and will be removed. Use integrate instead.")

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
```

Fixes:
- Use `warning` instead of `warn`.


#### QA Steps

Run any integration test that includes a `relate` call and make sure the warning is gone from the summary.
  • Loading branch information
jujubot authored Oct 3, 2023
2 parents f3905cd + 93c9b47 commit be013d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion juju/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1558,7 +1558,7 @@ async def relate(self, relation1, relation2):
The logic is the same.
"""
log.warn("relate is deprecated and will be removed. Use integrate instead.")
log.warning("relate is deprecated and will be removed. Use integrate instead.")
return await self.integrate(relation1, relation2)

async def add_space(self, name, cidrs=None, public=True):
Expand Down

0 comments on commit be013d7

Please sign in to comment.