File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
testprj/testapp/management/commands Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,13 @@ def test_django_traceback(manage):
170170 assert e .returncode == 1
171171
172172
173+ def test_click_exception (manage ):
174+ with pytest .raises (subprocess .CalledProcessError ) as e :
175+ manage ("clickexceptioncmd" )
176+ assert e .value .output == b"Error: Raised error description\n "
177+ assert e .value .returncode == 1
178+
179+
173180def test_django_settings (manage ):
174181 # The --settings switch only works from the command line (or if the django
175182 # settings where not setup before)... this means that we have to call it
Original file line number Diff line number Diff line change 1+ import djclick as click
2+
3+
4+ @click .command (version = "20.0" )
5+ def command ():
6+ raise click .ClickException ("Raised error description" )
You can’t perform that action at this time.
0 commit comments