MCPcopy Create free account
hub / github.com/pytest-dev/pytest / pluralize

Function pluralize

src/_pytest/terminal.py:1340–1350  ·  view source on GitHub ↗
(count: int, noun: str)

Source from the content-addressed store, hash-verified

1338
1339
1340def pluralize(count: int, noun: str) -> Tuple[int, str]:
1341 # No need to pluralize words such as `failed` or `passed`.
1342 if noun not in ["error", "warnings", "test"]:
1343 return count, noun
1344
1345 # The `warnings` key is plural. To avoid API breakage, we keep it that way but
1346 # set it to singular here so we can determine plurality in the same way as we do
1347 # for `error`.
1348 noun = noun.replace("warnings", "warning")
1349
1350 return count, noun + "s" if count != 1 else noun
1351
1352
1353def _plugin_nameversions(plugininfo) -> List[str]:

Calls

no outgoing calls

Tested by

no test coverage detected