-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add conftest with has_secrets fixture
- Loading branch information
1 parent
c27f6b1
commit 6ed4250
Showing
2 changed files
with
12 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright 2022 Canonical Ltd. | ||
# See LICENSE file for licensing details. | ||
import pytest | ||
from unittest.mock import PropertyMock | ||
|
||
# This causes every test defined in this file to run 2 times, each with | ||
# charm.JujuVersion.has_secrets set as True or as False | ||
@pytest.fixture(params=[True, False], autouse=True) | ||
def _has_secrets(request, monkeypatch): | ||
monkeypatch.setattr("charm.JujuVersion.has_secrets", PropertyMock(return_value=request.param)) | ||
return request.param |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters