Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 91ed065

Browse files
committed
test(check): fixes logic issue made evident by the latest fix(git) commit
git was failing with "fatal: ambiguous argument 'master..master': unknown revision or path not in the working tree". git `master` branch doesn't exist unless there is at least one "initial" commit or when only the PR branch has been cloned (e.g. CI).
1 parent b4dbd84 commit 91ed065

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎tests/commands/test_check_command.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
InvalidCommitMessageError,
1111
NoCommitsFoundError,
1212
)
13+
from tests.utils import create_file_and_commit
1314

1415
COMMIT_LOG = [
1516
"refactor: A code change that neither fixes a bug nor adds a feature",
@@ -217,7 +218,12 @@ def test_check_command_with_invalid_argument(config):
217218
)
218219

219220

221+
@pytest.mark.usefixtures("tmp_commitizen_project")
220222
def test_check_command_with_empty_range(config, mocker):
223+
224+
# must initialize git with a commit
225+
create_file_and_commit("feat: initial")
226+
221227
check_cmd = commands.Check(config=config, arguments={"rev_range": "master..master"})
222228
with pytest.raises(NoCommitsFoundError) as excinfo:
223229
check_cmd()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /