Skip to content

Commit 38cb734

Browse files
committed
Collections: Less confusing docs about msg. Fixes robotframework#3169.
1 parent ff6ae93 commit 38cb734

File tree

1 file changed

+8
-26
lines changed

1 file changed

+8
-26
lines changed

src/robot/libraries/Collections.py

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,7 @@ def sort_list(self, list_):
305305
def list_should_contain_value(self, list_, value, msg=None):
306306
"""Fails if the ``value`` is not found from ``list``.
307307
308-
If the keyword fails, the default error messages is ``<list> does
309-
not contain value '<value>'``. A custom message can be given using
310-
the ``msg`` argument.
308+
Use the ``msg`` argument to override the default error message.
311309
"""
312310
self._validate_list(list_)
313311
default = "%s does not contain value '%s'." % (seq2str2(list_), value)
@@ -316,7 +314,7 @@ def list_should_contain_value(self, list_, value, msg=None):
316314
def list_should_not_contain_value(self, list_, value, msg=None):
317315
"""Fails if the ``value`` is found from ``list``.
318316
319-
See `List Should Contain Value` for an explanation of ``msg``.
317+
Use the ``msg`` argument to override the default error message.
320318
"""
321319
self._validate_list(list_)
322320
default = "%s contains value '%s'." % (seq2str2(list_), value)
@@ -357,7 +355,6 @@ def lists_should_be_equal(self, list1, list2, msg=None, values=True,
357355
Abc``. The types of the lists do not need to be the same. For example,
358356
Python tuple and list with same content are considered equal.
359357
360-
361358
The error message can be configured using ``msg`` and ``values``
362359
arguments:
363360
- If ``msg`` is not given, the default error message is used.
@@ -686,9 +683,7 @@ def get_from_dictionary(self, dictionary, key):
686683
def dictionary_should_contain_key(self, dictionary, key, msg=None):
687684
"""Fails if ``key`` is not found from ``dictionary``.
688685
689-
See `List Should Contain Value` for an explanation of ``msg``.
690-
691-
The given dictionary is never altered by this keyword.
686+
Use the ``msg`` argument to override the default error message.
692687
"""
693688
self._validate_dictionary(dictionary)
694689
default = "Dictionary does not contain key '%s'." % key
@@ -697,9 +692,7 @@ def dictionary_should_contain_key(self, dictionary, key, msg=None):
697692
def dictionary_should_not_contain_key(self, dictionary, key, msg=None):
698693
"""Fails if ``key`` is found from ``dictionary``.
699694
700-
See `List Should Contain Value` for an explanation of ``msg``.
701-
702-
The given dictionary is never altered by this keyword.
695+
Use the ``msg`` argument to override the default error message.
703696
"""
704697
self._validate_dictionary(dictionary)
705698
default = "Dictionary contains key '%s'." % key
@@ -710,8 +703,7 @@ def dictionary_should_contain_item(self, dictionary, key, value, msg=None):
710703
711704
Value is converted to unicode for comparison.
712705
713-
See `Lists Should Be Equal` for an explanation of ``msg``.
714-
The given dictionary is never altered by this keyword.
706+
Use the ``msg`` argument to override the default error message.
715707
"""
716708
self._validate_dictionary(dictionary)
717709
self.dictionary_should_contain_key(dictionary, key, msg)
@@ -722,9 +714,7 @@ def dictionary_should_contain_item(self, dictionary, key, value, msg=None):
722714
def dictionary_should_contain_value(self, dictionary, value, msg=None):
723715
"""Fails if ``value`` is not found from ``dictionary``.
724716
725-
See `List Should Contain Value` for an explanation of ``msg``.
726-
727-
The given dictionary is never altered by this keyword.
717+
Use the ``msg`` argument to override the default error message.
728718
"""
729719
self._validate_dictionary(dictionary)
730720
default = "Dictionary does not contain value '%s'." % value
@@ -733,9 +723,7 @@ def dictionary_should_contain_value(self, dictionary, value, msg=None):
733723
def dictionary_should_not_contain_value(self, dictionary, value, msg=None):
734724
"""Fails if ``value`` is found from ``dictionary``.
735725
736-
See `List Should Contain Value` for an explanation of ``msg``.
737-
738-
The given dictionary is never altered by this keyword.
726+
Use the ``msg`` argument to override the default error message.
739727
"""
740728
self._validate_dictionary(dictionary)
741729
default = "Dictionary contains value '%s'." % value
@@ -751,8 +739,6 @@ def dictionaries_should_be_equal(self, dict1, dict2, msg=None, values=True):
751739
752740
See `Lists Should Be Equal` for more information about configuring
753741
the error message with ``msg`` and ``values`` arguments.
754-
755-
The given dictionaries are never altered by this keyword.
756742
"""
757743
self._validate_dictionary(dict1)
758744
self._validate_dictionary(dict2, 2)
@@ -765,8 +751,6 @@ def dictionary_should_contain_sub_dictionary(self, dict1, dict2, msg=None,
765751
766752
See `Lists Should Be Equal` for more information about configuring
767753
the error message with ``msg`` and ``values`` arguments.
768-
769-
The given dictionaries are never altered by this keyword.
770754
"""
771755
self._validate_dictionary(dict1)
772756
self._validate_dictionary(dict2, 2)
@@ -915,8 +899,6 @@ def should_contain_match(self, list, pattern, msg=None,
915899
whitespace_insensitive=False):
916900
"""Fails if ``pattern`` is not found in ``list``.
917901
918-
See `List Should Contain Value` for an explanation of ``msg``.
919-
920902
By default, pattern matching is similar to matching files in a shell
921903
and is case-sensitive and whitespace-sensitive. In the pattern syntax,
922904
``*`` matches to anything and ``?`` matches to any single character. You
@@ -938,7 +920,7 @@ def should_contain_match(self, list, pattern, msg=None,
938920
939921
Non-string values in lists are ignored when matching patterns.
940922
941-
The given list is never altered by this keyword.
923+
Use the ``msg`` argument to override the default error message.
942924
943925
See also ``Should Not Contain Match``.
944926

0 commit comments

Comments
 (0)