Skip to content

Commit b062ba7

Browse files
stratakisvstinner
authored andcommitted
bpo-35352: test_asyncio uses the certificate set from the test directory (GH-10826)
Modify asyncio tests to utilize the certificates from the test directory instead of its own set, as they are the same and with each update they had to be updated as well.
1 parent 9eea6ea commit b062ba7

File tree

6 files changed

+4
-185
lines changed

6 files changed

+4
-185
lines changed

Lib/test/test_asyncio/keycert3.pem

Lines changed: 0 additions & 73 deletions
This file was deleted.

Lib/test/test_asyncio/pycacert.pem

Lines changed: 0 additions & 78 deletions
This file was deleted.

Lib/test/test_asyncio/ssl_cert.pem

Lines changed: 0 additions & 15 deletions
This file was deleted.

Lib/test/test_asyncio/ssl_key.pem

Lines changed: 0 additions & 16 deletions
This file was deleted.

Lib/test/test_asyncio/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def data_file(filename):
4040
fullname = os.path.join(support.TEST_HOME_DIR, filename)
4141
if os.path.isfile(fullname):
4242
return fullname
43-
fullname = os.path.join(os.path.dirname(__file__), filename)
43+
fullname = os.path.join(os.path.dirname(__file__), '..', filename)
4444
if os.path.isfile(fullname):
4545
return fullname
4646
raise FileNotFoundError(filename)
@@ -160,8 +160,8 @@ def finish_request(self, request, client_address):
160160
if not os.path.isdir(here):
161161
here = os.path.join(os.path.dirname(os.__file__),
162162
'test', 'test_asyncio')
163-
keyfile = os.path.join(here, 'ssl_key.pem')
164-
certfile = os.path.join(here, 'ssl_cert.pem')
163+
keyfile = os.path.join(here, ONLYKEY)
164+
certfile = os.path.join(here, ONLYCERT)
165165
context = ssl.SSLContext()
166166
context.load_cert_chain(certfile, keyfile)
167167

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Modify test_asyncio to use the certificate set from the test directory.

0 commit comments

Comments
 (0)