File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -421,6 +421,25 @@ def test_two(capfd, capsys):
421
421
"*capsys*capfd*same*time*" ,
422
422
"*2 error*" ])
423
423
424
+ def test_capturing_getfixturevalue (self , testdir ):
425
+ """Test that asking for "capfd" and "capsys" using request.getfixturevalue
426
+ in the same test is an error.
427
+ """
428
+ testdir .makepyfile ("""
429
+ def test_one(capsys, request):
430
+ request.getfixturevalue("capfd")
431
+ def test_two(capfd, request):
432
+ request.getfixturevalue("capsys")
433
+ """ )
434
+ result = testdir .runpytest ()
435
+ result .stdout .fnmatch_lines ([
436
+ "*test_one*" ,
437
+ "*capsys*capfd*same*time*" ,
438
+ "*test_two*" ,
439
+ "*capsys*capfd*same*time*" ,
440
+ "*2 failed in*" ,
441
+ ])
442
+
424
443
@pytest .mark .parametrize ("method" , ["sys" , "fd" ])
425
444
def test_capture_is_represented_on_failure_issue128 (self , testdir , method ):
426
445
p = testdir .makepyfile ("""
You can’t perform that action at this time.
0 commit comments