Skip to content

Commit 4c46610

Browse files
authored
Merge pull request #162 from TTWShell/fix/test
fixed test: tests/test_hobbit.py::TestHobbit::test_not_exist_cmd
2 parents 70dcc1e + 2d40e62 commit 4c46610

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

.circleci/config.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,15 @@ jobs:
8787
hobbit --echo startproject -n demo -f -p 1024
8888
mkdir ~/hahaha && cd ~/hahaha
8989
hobbit --echo startproject -n demo -t rivendell -p 1025
90-
- run:
91-
name: tree flask project
92-
command: |
93-
cd ~/haha
94-
apt-get install -y tree
95-
tree
96-
cd ~/hahaha
97-
tree
90+
# - run:
91+
# name: tree flask project
92+
# command: |
93+
# cd ~/haha
94+
# apt-get update
95+
# apt-get install -y tree
96+
# tree
97+
# cd ~/hahaha
98+
# tree
9899
- run:
99100
name: run tests
100101
command: |

tests/test_hobbit.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ def runner(self):
2727

2828
def test_not_exist_cmd(self, runner):
2929
result = runner.invoke(hobbit)
30-
assert result.exit_code == 0
30+
# https://github.com/pallets/click/releases/tag/8.2.0
31+
# If help is shown because no_args_is_help is enabled
32+
# (defaults to True for groups, False for commands),
33+
# the exit code is 2 instead of 0.
34+
assert result.exit_code in [0, 2]
3135

3236
result = runner.invoke(hobbit, ['doesnotexistcmd'], obj={})
3337
assert 'Error: cmd not exist: doesnotexistcmd' in result.output

0 commit comments

Comments
 (0)