File tree Expand file tree Collapse file tree 3 files changed +15
-8
lines changed Expand file tree Collapse file tree 3 files changed +15
-8
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff 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
1011venv::_version () {
1112 echo " venv-cli ${_version} "
Original file line number Diff line number Diff line change 11import re
2- from pathlib import Path
32
43import pytest
54
65from 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 () )
You can’t perform that action at this time.
0 commit comments