Skip to content

Commit

Permalink
Use a decorator instead of with statement
Browse files Browse the repository at this point in the history
  • Loading branch information
james-garner-canonical committed Sep 17, 2024
1 parent efa9990 commit 331816a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/unit/test_snap.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ def __init__(self):


class TestSnapCache(unittest.TestCase):
@patch.object(snap.SnapCache, "snapd_installed", new=False)
def test_error_on_not_snapd_installed(self):
with patch.object(snap.SnapCache, "snapd_installed", new=False):
with self.assertRaises(snap.SnapError):
snap.SnapCache()
with self.assertRaises(snap.SnapError):
snap.SnapCache()

@patch(
"charms.operator_libs_linux.v2.snap.subprocess.check_output",
Expand Down

0 comments on commit 331816a

Please sign in to comment.