Skip to content

Commit 90a33ff

Browse files
committed
Alter test to match version pattern not exact version
1 parent 893c124 commit 90a33ff

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
repos:
2+
- repo: local
3+
hooks:
4+
- id: shredguard-check
5+
name: shredguard check
6+
entry: shredguard check
7+
language: system
8+
types: [text]

tests/test_cli.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from click.testing import CliRunner
77

88
from shredguard.cli import main
9+
import re
910

1011

1112
@pytest.fixture
@@ -262,7 +263,8 @@ def test_version(self, runner: CliRunner):
262263

263264
assert result.exit_code == 0
264265
assert "shredguard" in result.output.lower()
265-
assert "0.1.0" in result.output
266+
# Accept any version pattern like 0.1.0, 1.2.3, etc.
267+
assert re.search(r"\d+\.\d+\.\d+", result.output)
266268

267269

268270
class TestHelpFlag:

0 commit comments

Comments
 (0)