Skip to content

Commit 04a98d0

Browse files
committed
Fix issues with environment test on windows
1 parent b73a6e1 commit 04a98d0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

tests/test_hooks/test_run_command.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import subprocess
2+
import sys
23

34
import pytest
45

@@ -16,7 +17,8 @@ def test_runs_a_str_command(self):
1617

1718
def test_can_access_env(self):
1819
"""The command can access custom environment variables."""
19-
result = run_command("echo $TEST_ENV", environment={"TEST_ENV": "Hello"})
20+
cmd = "echo %TEST_ENV%" if sys.platform == "win32" else "echo $TEST_ENV"
21+
result = run_command(cmd, environment={"TEST_ENV": "Hello"})
2022
assert isinstance(result, subprocess.CompletedProcess)
2123
assert result.stdout == "Hello\n"
2224

tests/test_hooks/test_run_setup_hooks.py tests/test_hooks/test_run_hook_suites.py

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import pytest
55
from pytest import param
66
from bumpversion.hooks import run_setup_hooks, run_pre_commit_hooks, run_post_commit_hooks
7-
from bumpversion.versioning.models import Version
87
from tests.conftest import get_config_data, get_semver
98

109

0 commit comments

Comments
 (0)