Skip to content

Commit 0ca6ca4

Browse files
committed
PYTHON-2808 Use Invoke-WebRequest instead certifi to workaround FLE test issue (#714)
(cherry picked from commit 6913738)
1 parent f60bce2 commit 0ca6ca4

File tree

2 files changed

+3
-26
lines changed

2 files changed

+3
-26
lines changed

.evergreen/run-tests.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ if [ -n "$TEST_ENCRYPTION" ]; then
129129

130130
if [ "Windows_NT" = "$OS" ]; then # Magic variable in cygwin
131131
$PYTHON -m pip install -U setuptools
132+
# PYTHON-2808 Ensure this machine has the CA cert for google KMS.
133+
powershell.exe "Invoke-WebRequest -URI https://oauth2.googleapis.com/" > /dev/null || true
132134
fi
133135

134136
if [ -z "$LIBMONGOCRYPT_URL" ]; then
@@ -171,10 +173,6 @@ if [ -n "$TEST_ENCRYPTION" ]; then
171173
. $DRIVERS_TOOLS/.evergreen/csfle/set-temp-creds.sh
172174

173175
# Start the mock KMS servers.
174-
if [ "$OS" = "Windows_NT" ]; then
175-
# Remove after BUILD-13574.
176-
python -m pip install certifi
177-
fi
178176
# The mock KMS server requires Python >=3.5 with boto3.
179177
IS_PRE_35=$(python -c "import sys; sys.stdout.write('1' if sys.version_info < (3, 5) else '0')")
180178
if [ $IS_PRE_35 = "1" ]; then

test/test_encryption.py

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@
5656
from test import (unittest,
5757
client_context,
5858
IntegrationTest,
59-
PyMongoTestCase,
60-
SystemCertsPatcher)
59+
PyMongoTestCase)
6160
from test.utils import (TestCreator,
6261
camel_to_snake_args,
6362
OvertCommandListener,
@@ -67,26 +66,6 @@
6766
wait_until)
6867
from test.utils_spec_runner import SpecRunner
6968

70-
try:
71-
import certifi
72-
HAVE_CERTIFI = True
73-
except ImportError:
74-
HAVE_CERTIFI = False
75-
76-
patcher = None
77-
78-
79-
def setUpModule():
80-
if sys.platform == 'win32' and HAVE_CERTIFI:
81-
# Remove after BUILD-13574.
82-
global patcher
83-
patcher = SystemCertsPatcher(certifi.where())
84-
85-
86-
def tearDownModule():
87-
if patcher:
88-
patcher.disable()
89-
9069

9170
def get_client_opts(client):
9271
return client._MongoClient__options

0 commit comments

Comments
 (0)