bpo-27200: fix pathlib, ssl, turtle and weakref doctests#616
Conversation
|
@marco-buttu, thanks for your PR! By analyzing the history of the files in this pull request, we identified @eliben, @birkenfeld, @vsajip, @tiran and @loewis to be potential reviewers. |
Sorry, something went wrong.
The setcontext(Context()) in testsetup does not guarantee that the tests outside this file have a clean context. We need to clean the context at the end of the tests.
berkerpeksag
left a comment
There was a problem hiding this comment.
I think we also need to following change to ssl examples:
diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst
index 01dbecd..02a0c79 100644
--- a/Doc/library/ssl.rst
+++ b/Doc/library/ssl.rst
@@ -2262,7 +2262,7 @@ SSL versions 2 and 3 are considered insecure and are therefore dangerous to
use. If you want maximum compatibility between clients and servers, it is
recommended to use :const:`PROTOCOL_TLS_CLIENT` or
:const:`PROTOCOL_TLS_SERVER` as the protocol version. SSLv2 and SSLv3 are
-disabled by default.
+disabled by default. ::
>>> client_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
>>> client_context.options |= ssl.OP_NO_TLSv1And there are the other failures:
**********************************************************************
File "library/ssl.rst", line 421, in newcontext
Failed example:
timestamp
Expected:
1515144883
Got:
1515134083.0
**********************************************************************
File "library/ssl.rst", line 424, in newcontext
Failed example:
print(datetime.utcfromtimestamp(timestamp))
Expected:
2018-01-05 09:34:43
Got:
2018-01-05 06:34:43
Sorry, something went wrong.
|
Thank you very much for your time @berkerpeksag! I made all changes you requested me. Just one question: you got a |
Sorry, something went wrong.
|
I don't know, it's probably worth doing some VCS archaeology :) I built and ran tests in Python 3.4 with an ancient OpenSSL so this might be the culprit. |
Sorry, something went wrong.
|
Thanks! |
Sorry, something went wrong.
This PR is the last but one in the series bpo-27200. The first one was #240, the second one #401, and the third #604. To run the doctests (from the
Docdirectory):