Merge pull request #4532 from nicoddemus/failure-summary
Change -ra to show errors and failures last, instead of first
This commit is contained in:
		
						commit
						f96e1b6f3e
					
				|  | @ -0,0 +1,3 @@ | ||||||
|  | ``-ra`` now will show errors and failures last, instead of as the first items in the summary. | ||||||
|  | 
 | ||||||
|  | This makes it easier to obtain a list of errors and failures to run tests selectively. | ||||||
|  | @ -167,7 +167,7 @@ def getreportopt(config): | ||||||
|             if char not in reportopts and char != "a": |             if char not in reportopts and char != "a": | ||||||
|                 reportopts += char |                 reportopts += char | ||||||
|             elif char == "a": |             elif char == "a": | ||||||
|                 reportopts = "fEsxXw" |                 reportopts = "sxXwEf" | ||||||
|     return reportopts |     return reportopts | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -875,11 +875,22 @@ def test_reportchars_all(testdir): | ||||||
|             pass |             pass | ||||||
|         def test_4(): |         def test_4(): | ||||||
|             pytest.skip("four") |             pytest.skip("four") | ||||||
|  |         @pytest.fixture | ||||||
|  |         def fail(): | ||||||
|  |             assert 0 | ||||||
|  |         def test_5(fail): | ||||||
|  |             pass | ||||||
|     """ |     """ | ||||||
|     ) |     ) | ||||||
|     result = testdir.runpytest("-ra") |     result = testdir.runpytest("-ra") | ||||||
|     result.stdout.fnmatch_lines( |     result.stdout.fnmatch_lines( | ||||||
|         ["FAIL*test_1*", "SKIP*four*", "XFAIL*test_2*", "XPASS*test_3*"] |         [ | ||||||
|  |             "SKIP*four*", | ||||||
|  |             "XFAIL*test_2*", | ||||||
|  |             "XPASS*test_3*", | ||||||
|  |             "ERROR*test_5*", | ||||||
|  |             "FAIL*test_1*", | ||||||
|  |         ] | ||||||
|     ) |     ) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue