Default color is now yellow
Passing tests override that default, making the color green; but several other "boring" statuses (xfailed, xpassed, deselected, skipped) have no effect. Net effect: if only "boring" tests are seen, or no tests at all, the summary bar is yellow.
This commit is contained in:
		
							parent
							
								
									044d874c5b
								
							
						
					
					
						commit
						6c395cb58c
					
				|  | @ -545,7 +545,9 @@ def build_summary_stats_line(stats): | ||||||
|         color = 'red' |         color = 'red' | ||||||
|     elif 'warnings' in stats or unknown_key_seen: |     elif 'warnings' in stats or unknown_key_seen: | ||||||
|         color = 'yellow' |         color = 'yellow' | ||||||
|     else: |     elif 'passed' in stats: | ||||||
|         color = 'green' |         color = 'green' | ||||||
|  |     else: | ||||||
|  |         color = 'yellow' | ||||||
| 
 | 
 | ||||||
|     return (line, color) |     return (line, color) | ||||||
|  |  | ||||||
|  | @ -725,6 +725,7 @@ def test_terminal_summary(testdir): | ||||||
|     # dict value, not the actual contents, so tuples of anything |     # dict value, not the actual contents, so tuples of anything | ||||||
|     # suffice |     # suffice | ||||||
| 
 | 
 | ||||||
|  |     # Important statuses -- the highest priority of these always wins | ||||||
|     ("red",    "1 failed",               {"failed":     (1,)}), |     ("red",    "1 failed",               {"failed":     (1,)}), | ||||||
|     ("red",    "1 failed, 1 passed",     {"failed":     (1,), "passed": (1,)}), |     ("red",    "1 failed, 1 passed",     {"failed":     (1,), "passed": (1,)}), | ||||||
| 
 | 
 | ||||||
|  | @ -740,23 +741,28 @@ def test_terminal_summary(testdir): | ||||||
| 
 | 
 | ||||||
|     ("green",  "5 passed",               {"passed":     (1,2,3,4,5)}), |     ("green",  "5 passed",               {"passed":     (1,2,3,4,5)}), | ||||||
| 
 | 
 | ||||||
|     ("green",  "1 skipped",              {"skipped":    (1,)}), | 
 | ||||||
|  |     # "Boring" statuses.  These have no effect on the color of the summary | ||||||
|  |     # line.  Thus, if *every* test has a boring status, the summary line stays | ||||||
|  |     # at its default color, i.e. yellow, to warn the user that the test run | ||||||
|  |     # produced no useful information | ||||||
|  |     ("yellow", "1 skipped",              {"skipped":    (1,)}), | ||||||
|     ("green",  "1 passed, 1 skipped",    {"skipped":    (1,), "passed": (1,)}), |     ("green",  "1 passed, 1 skipped",    {"skipped":    (1,), "passed": (1,)}), | ||||||
| 
 | 
 | ||||||
|     ("green",  "1 deselected",           {"deselected": (1,)}), |     ("yellow", "1 deselected",           {"deselected": (1,)}), | ||||||
|     ("green",  "1 passed, 1 deselected", {"deselected": (1,), "passed": (1,)}), |     ("green",  "1 passed, 1 deselected", {"deselected": (1,), "passed": (1,)}), | ||||||
| 
 | 
 | ||||||
|     ("green",  "1 xfailed",              {"xfailed":    (1,)}), |     ("yellow", "1 xfailed",              {"xfailed":    (1,)}), | ||||||
|     ("green",  "1 passed, 1 xfailed",    {"xfailed":    (1,), "passed": (1,)}), |     ("green",  "1 passed, 1 xfailed",    {"xfailed":    (1,), "passed": (1,)}), | ||||||
| 
 | 
 | ||||||
|     ("green",  "1 xpassed",              {"xpassed":    (1,)}), |     ("yellow", "1 xpassed",              {"xpassed":    (1,)}), | ||||||
|     ("green",  "1 passed, 1 xpassed",    {"xpassed":    (1,), "passed": (1,)}), |     ("green",  "1 passed, 1 xpassed",    {"xpassed":    (1,), "passed": (1,)}), | ||||||
| 
 | 
 | ||||||
|     # No tests were found at all |     # Likewise if no tests were found at all | ||||||
|     ("green",  "",                       {}), |     ("yellow", "",                       {}), | ||||||
| 
 | 
 | ||||||
|     # Test the empty-key special case |     # Test the empty-key special case | ||||||
|     ("green",  "",                       {"": (1,)}), |     ("yellow", "",                       {"": (1,)}), | ||||||
|     ("green",  "1 passed",               {"": (1,), "passed": (1,)}), |     ("green",  "1 passed",               {"": (1,), "passed": (1,)}), | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue