File tree Expand file tree Collapse file tree
packages/google-api-core/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # -*- coding: utf-8 -*-
2+ # Copyright 2026 Google LLC
3+ #
4+ # Licensed under the Apache License, Version 2.0 (the "License");
5+ # you may not use this file except in compliance with the License.
6+ # You may obtain a copy of the License at
7+ #
8+ # http://www.apache.org/licenses/LICENSE-2.0
9+ #
10+ # Unless required by applicable law or agreed to in writing, software
11+ # distributed under the License is distributed on an "AS IS" BASIS,
12+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ # See the License for the specific language governing permissions and
14+ # limitations under the License.
15+
16+ import os
17+ from unittest import mock
18+ import pytest
19+
20+
21+ @pytest .fixture (scope = "session" , autouse = True )
22+ def mock_mtls_env ():
23+ """Autouse session-scoped fixture to isolate unit tests from workstation mTLS environments."""
24+ with mock .patch .dict (
25+ os .environ ,
26+ {
27+ "GOOGLE_API_USE_CLIENT_CERTIFICATE" : "false" ,
28+ "CLOUDSDK_CONTEXT_AWARE_USE_CLIENT_CERTIFICATE" : "false" ,
29+ },
30+ ):
31+ yield
You can’t perform that action at this time.
0 commit comments