@@ -364,16 +364,12 @@ def lists_should_be_equal(self, list1, list2, msg=None, values=True,
364
364
- If ``msg`` is given and ``values`` is not given a true value,
365
365
the error message is just the given ``msg``.
366
366
367
- Optional ``names`` argument can be used for naming the indices shown in
368
- the default error message. It can either be a list of names matching
369
- the indices in the lists or a dictionary where keys are indices that
370
- need to be named. It is not necessary to name all of the indices. When
371
- using a dictionary, keys can be either integers or strings that can be
372
- converted to integers.
373
-
374
- Optional ``ignore_order`` argument can be used to ignore the order of the
375
- elements (element index) in the list while comparing two lists. If set to
376
- true, element order will be ignored. This option is new in RF 3.2 now.
367
+ The optional ``names`` argument can be used for naming the indices
368
+ shown in the default error message. It can either be a list of names
369
+ matching the indices in the lists or a dictionary where keys are
370
+ indices that need to be named. It is not necessary to name all of
371
+ the indices. When using a dictionary, keys can be either integers
372
+ or strings that can be converted to integers.
377
373
378
374
Examples:
379
375
| ${names} = | Create List | First Name | Family Name | Email |
@@ -384,13 +380,15 @@ def lists_should_be_equal(self, list1, list2, msg=None, values=True,
384
380
If the items in index 2 would differ in the above examples, the error
385
381
message would contain a row like ``Index 2 (email): [email protected] !=
386
382
387
-
383
+
384
+ The optional ``ignore_order`` argument can be used to ignore the order
385
+ of the elements in the lists. Using it requires items to be sortable.
386
+ This is new in Robot Framework 3.2.
387
+
388
+ Example:
388
389
| ${list1} = | Create List | apple | cherry | banana |
389
390
| ${list2} = | Create List | cherry | banana | apple |
390
391
| Lists Should Be Equal | ${list1} | ${list2} | ignore_order=True |
391
-
392
- list index would be ignored while comparing two lists. Above two list
393
- will be matched.
394
392
"""
395
393
self ._validate_lists (list1 , list2 )
396
394
len1 = len (list1 )
0 commit comments