File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 11
11
ASYNC_GENERATORS = sys .version_info >= (3 , 6 )
12
12
13
13
14
+ # https://github.com/pytest-dev/pytest/issues/6505
15
+ def force_plural (name ):
16
+ if name in {"error" , "warning" }:
17
+ return name + "s"
18
+
19
+ return name
20
+
21
+
14
22
def assert_outcomes (run_result , outcomes ):
15
23
formatted_output = format_run_result_output_for_assert (run_result )
16
24
@@ -19,8 +27,13 @@ def assert_outcomes(run_result, outcomes):
19
27
except ValueError :
20
28
assert False , formatted_output
21
29
30
+ normalized_outcomes = {
31
+ force_plural (name ): outcome
32
+ for name , outcome in result_outcomes .items ()
33
+ }
34
+
22
35
for name , value in outcomes .items ():
23
- assert result_outcomes .get (name ) == value , formatted_output
36
+ assert normalized_outcomes .get (name ) == value , formatted_output
24
37
25
38
26
39
def format_run_result_output_for_assert (run_result ):
You can’t perform that action at this time.
0 commit comments