Skip to content

Commit f7807b3

Browse files
committed
Merge branch 'v1.0.2'
2 parents 0c3d161 + e055e0b commit f7807b3

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
# Changelog
22

3+
## [v1.0.2](https://github.com/SallingGroup-AI-and-ML/venv-cli/releases/tag/v1.0.2) (2023-08-02)
4+
5+
* Fixed test that checks the version number follows the required pattern.
6+
37
## [v1.0.1](https://github.com/SallingGroup-AI-and-ML/venv-cli/releases/tag/v1.0.1) (2023-08-02)
48

59
* Added support for `zsh` shell.
6-
* Added `CHANGELOG.md`
10+
* Added `CHANGELOG.md`.
711

812
## [1.0.0](https://github.com/SallingGroup-AI-and-ML/venv-cli/releases/tag/v1.0.0) (2023-07-13)
913

src/venv-cli/venv.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ _green="\033[32m"
55
_yellow="\033[01;33m"
66
_red="\033[31m"
77

8-
_version="v1.0.1"
8+
# Version number has to follow pattern "^v\d+\.\d+\.\d+.*$"
9+
_version="v1.0.2"
910

1011
venv::_version() {
1112
echo "venv-cli ${_version}"

tests/test_venv_version.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
import re
2-
from pathlib import Path
32

43
import pytest
54

65
from tests.helpers import run_command
76

7+
_version_pattern = re.compile(r"^venv-cli v\d+\.\d+\.\d+.*$")
8+
89

910
@pytest.mark.parametrize("arg", ["-V", "--version"])
10-
def test_venv_help(arg: str, tmp_path: Path, capfd: pytest.CaptureFixture):
11-
"""Checks that we can show the version number"""
12-
run_command(f"venv {arg}", cwd=tmp_path)
11+
def test_venv_version(arg: str, capfd: pytest.CaptureFixture):
12+
"""Checks that we can show the version number, and that the version number
13+
complies with the required pattern"""
14+
run_command(f"venv {arg}")
1315

14-
captured = capfd.readouterr()
15-
assert re.search(r"venv-cli\s\d+?\.\d+?\.\d+?", captured.out)
16+
output = capfd.readouterr().out
17+
assert re.match(_version_pattern, output.strip())

0 commit comments

Comments
 (0)