summaryrefslogtreecommitdiff
path: root/pylint
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2020-10-24 15:20:37 +0200
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2020-11-29 11:59:49 +0100
commitcdaa74e8a7f97485372e3b060696664416223d28 (patch)
tree7657a387103af48dfbf926ed80a883c06b3197fa /pylint
parent86fa61c8dc5ada550e24c37157f48b4b209c5253 (diff)
downloadpylint-git-cdaa74e8a7f97485372e3b060696664416223d28.tar.gz
Use typing instead of docstring in multiset_difference
Diffstat (limited to 'pylint')
-rw-r--r--pylint/testutils/utils.py18
1 files changed, 5 insertions, 13 deletions
diff --git a/pylint/testutils/utils.py b/pylint/testutils/utils.py
index f2b45e2d5..e425f523a 100644
--- a/pylint/testutils/utils.py
+++ b/pylint/testutils/utils.py
@@ -18,6 +18,7 @@ from glob import glob
from io import StringIO
from os import close, remove, write
from os.path import abspath, basename, dirname, exists, join, splitext
+from typing import Tuple
import astroid
import pytest
@@ -378,21 +379,12 @@ def get_expected_messages(stream):
return messages
-def multiset_difference(left_op, right_op):
+def multiset_difference(expected_entries: set, actual_entries: set) -> Tuple[set]:
"""Takes two multisets and compares them.
- A multiset is a dict with the cardinality of the key as the value.
-
- :param left_op: The expected entries.
- :type left_op: set
- :param right_op: Actual entries.
- :type right_op: set
-
- :returns: The two multisets of missing and unexpected messages.
- :rtype: tuple
- """
- missing = left_op.copy()
- missing.subtract(right_op)
+ A multiset is a dict with the cardinality of the key as the value."""
+ missing = expected_entries.copy()
+ missing.subtract(actual_entries)
unexpected = {}
for key, value in list(missing.items()):
if value <= 0: