File tree Expand file tree Collapse file tree 1 file changed +33
-3
lines changed Expand file tree Collapse file tree 1 file changed +33
-3
lines changed Original file line number Diff line number Diff line change @@ -377,15 +377,45 @@ def test_io(self):
377377 result .stdout .fnmatch_lines (["* 1 skipped *" ])
378378
379379
380- def test_issue_6517 (testdir ):
380+ def test_raises (testdir ):
381381 testdir .makepyfile (
382382 """
383383 from nose.tools import raises
384384
385385 @raises(RuntimeError)
386- def test_fail_without_tcp ():
386+ def test_raises_runtimeerror ():
387387 raise RuntimeError
388+
389+ @raises(Exception)
390+ def test_raises_baseexception_not_caught():
391+ raise BaseException
392+
393+ @raises(BaseException)
394+ def test_raises_baseexception_caught():
395+ raise BaseException
388396 """
389397 )
390398 result = testdir .runpytest ()
391- result .stdout .fnmatch_lines (["* 1 passed *" ])
399+ result .stdout .fnmatch_lines (
400+ [
401+ "*= FAILURES =*" ,
402+ "*_ test_raises_baseexception_not_caught _*" ,
403+ "" ,
404+ "arg = (), kw = {}" ,
405+ "" ,
406+ " def newfunc(*arg, **kw):" ,
407+ " try:" ,
408+ "> func(*arg, **kw)" ,
409+ "" ,
410+ "*/nose/*: " ,
411+ "_ _ *" ,
412+ "" ,
413+ " @raises(Exception)" ,
414+ " def test_raises_baseexception_not_caught():" ,
415+ "> raise BaseException" ,
416+ "E BaseException" ,
417+ "" ,
418+ "test_raises.py:9: BaseException" ,
419+ "* 1 failed, 2 passed *" ,
420+ ]
421+ )
You can’t perform that action at this time.
0 commit comments