diff options
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/doctest.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/library/doctest.rst b/Doc/library/doctest.rst index 9913309..694a43f 100644 --- a/Doc/library/doctest.rst +++ b/Doc/library/doctest.rst @@ -800,18 +800,18 @@ guarantee about output. For example, when printing a set, Python doesn't guarantee that the element is printed in any particular order, so a test like :: >>> foo() - {"Hermione", "Harry"} + {"spam", "eggs"} is vulnerable! One workaround is to do :: - >>> foo() == {"Hermione", "Harry"} + >>> foo() == {"spam", "eggs"} True instead. Another is to do :: >>> d = sorted(foo()) >>> d - ['Harry', 'Hermione'] + ['eggs', 'spam'] There are others, but you get the idea. |