Skip to content

Commit 810192d

Browse files
committed
exclude
1 parent 772cba5 commit 810192d

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

tests/providers/vault/test_vault_config.py

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
from pathlib import Path
23

34
import pytest
@@ -13,6 +14,9 @@
1314

1415
class TestRawVaultUserConfig:
1516
def test_success(self, tmp_path: Path):
17+
if "VAULT_ADDR" in os.environ:
18+
pytest.skip("VAULT_ADDR is set. Skipping test.")
19+
1620
(tmp_path / "ca.cert").touch()
1721
(tmp_path / "client.pem").touch()
1822
(tmp_path / "client.key").touch()
@@ -156,9 +160,11 @@ def test_success_3(self, tmp_path: Path):
156160
assert parsed["proxy"] == "http://proxy.example.com/"
157161
assert parsed["client_cert"] == tmp_path / "client.pem"
158162

159-
def test_fail(self):
163+
def test_fail_1(self):
164+
if "VAULT_ADDR" in os.environ:
165+
pytest.skip("VAULT_ADDR is set. Skipping test.")
160166
assert get_connection_info({"auth": "null"}) is None
161-
assert (
162-
get_connection_info({"url": "https://example.com", "auth": "invalid"})
163-
is None
164-
)
167+
168+
def test_fail_2(self):
169+
out = get_connection_info({"url": "https://example.com", "auth": "invalid"})
170+
assert out is None

0 commit comments

Comments
 (0)