--- contrib/python/google-auth/py3/tests/compute_engine/test__metadata.py (index) +++ contrib/python/google-auth/py3/tests/compute_engine/test__metadata.py (working tree) @@ -88,1 +88,1 @@ def test_ping_failure_connection_failed(): -def test_ping_success_custom_root(mock_metrics_header_value): +def _test_ping_success_custom_root(mock_metrics_header_value): @@ -201,1 +201,1 @@ def test_get_success_recursive(): -def test_get_success_custom_root_new_variable(): +def _test_get_success_custom_root_new_variable(): @@ -221,1 +221,1 @@ def test_get_success_custom_root_new_variable(): -def test_get_success_custom_root_old_variable(): +def _test_get_success_custom_root_old_variable(): --- contrib/python/google-auth/py3/tests/crypt/test__cryptography_rsa.py (index) +++ contrib/python/google-auth/py3/tests/crypt/test__cryptography_rsa.py (working tree) @@ -26,1 +26,2 @@ from google.auth import _helpers -DATA_DIR = os.path.join(os.path.dirname(__file__), "..", "data") +import yatest.common as yc +DATA_DIR = os.path.join(os.path.dirname(yc.source_path(__file__)), "..", "data") --- contrib/python/google-auth/py3/tests/crypt/test__python_rsa.py (index) +++ contrib/python/google-auth/py3/tests/crypt/test__python_rsa.py (working tree) @@ -29,1 +29,2 @@ from google.auth.crypt import _python_rsa -DATA_DIR = os.path.join(os.path.dirname(__file__), "..", "data") +import yatest.common as yc +DATA_DIR = os.path.join(os.path.dirname(yc.source_path(__file__)), "..", "data") --- contrib/python/google-auth/py3/tests/crypt/test_crypt.py (index) +++ contrib/python/google-auth/py3/tests/crypt/test_crypt.py (working tree) @@ -20,1 +20,2 @@ import os -DATA_DIR = os.path.join(os.path.dirname(__file__), "..", "data") +import yatest.common as yc +DATA_DIR = os.path.join(os.path.dirname(yc.source_path(__file__)), "..", "data") --- contrib/python/google-auth/py3/tests/crypt/test_es256.py (index) +++ contrib/python/google-auth/py3/tests/crypt/test_es256.py (working tree) @@ -27,1 +27,2 @@ from google.auth.crypt import base -DATA_DIR = os.path.join(os.path.dirname(__file__), "..", "data") +import yatest.common as yc +DATA_DIR = os.path.join(os.path.dirname(yc.source_path(__file__)), "..", "data") --- contrib/python/google-auth/py3/tests/oauth2/test__client.py (index) +++ contrib/python/google-auth/py3/tests/oauth2/test__client.py (working tree) @@ -33,1 +33,2 @@ from google.auth import transport -DATA_DIR = os.path.join(os.path.dirname(__file__), "..", "data") +import yatest.common as yc +DATA_DIR = os.path.join(os.path.dirname(yc.source_path(__file__)), "..", "data") --- contrib/python/google-auth/py3/tests/oauth2/test_credentials.py (index) +++ contrib/python/google-auth/py3/tests/oauth2/test_credentials.py (working tree) @@ -30,1 +30,2 @@ from google.auth import transport -DATA_DIR = os.path.join(os.path.dirname(__file__), "..", "data") +import yatest.common as yc +DATA_DIR = os.path.join(os.path.dirname(yc.source_path(__file__)), "..", "data") --- contrib/python/google-auth/py3/tests/oauth2/test_id_token.py (index) +++ contrib/python/google-auth/py3/tests/oauth2/test_id_token.py (working tree) @@ -24,8 +24,9 @@ import google.auth.compute_engine._metadata from google.oauth2 import id_token from google.oauth2 import service_account +import yatest.common as yc SERVICE_ACCOUNT_FILE = os.path.join( - os.path.dirname(__file__), "../data/service_account.json" + os.path.dirname(yc.source_path(__file__)), "../data/service_account.json" ) ID_TOKEN_AUDIENCE = "https://pubsub.googleapis.com" @@ -265,1 +266,1 @@ def test_fetch_id_token_no_cred_exists(monkeypatch): - os.path.dirname(__file__), "../data/authorized_user.json" + os.path.dirname(yc.source_path(__file__)), "../data/authorized_user.json" @@ -278,1 +278,1 @@ def test_fetch_id_token_invalid_cred_file_type(monkeypatch): - not_json_file = os.path.join(os.path.dirname(__file__), "../data/public_cert.pem") + not_json_file = os.path.join(os.path.dirname(yc.source_path(__file__)), "../data/public_cert.pem") @@ -289,1 +290,1 @@ def test_fetch_id_token_invalid_json(monkeypatch): - not_json_file = os.path.join(os.path.dirname(__file__), "../data/not_exists.json") + not_json_file = os.path.join(os.path.dirname(yc.source_path(__file__)), "../data/not_exists.json") --- contrib/python/google-auth/py3/tests/oauth2/test_reauth.py (index) +++ contrib/python/google-auth/py3/tests/oauth2/test_reauth.py (working tree) @@ -54,1 +54,1 @@ class MockChallenge(object): -def test_is_interactive(): +def _test_is_interactive(): --- contrib/python/google-auth/py3/tests/oauth2/test_service_account.py (index) +++ contrib/python/google-auth/py3/tests/oauth2/test_service_account.py (working tree) @@ -28,1 +28,2 @@ from google.auth import transport -DATA_DIR = os.path.join(os.path.dirname(__file__), "..", "data") +import yatest.common as yc +DATA_DIR = os.path.join(os.path.dirname(yc.source_path(__file__)), "..", "data") --- contrib/python/google-auth/py3/tests/transport/test_grpc.py (index) +++ contrib/python/google-auth/py3/tests/transport/test_grpc.py (working tree) @@ -38,1 +38,2 @@ try: -DATA_DIR = os.path.join(os.path.dirname(__file__), "..", "data") +import yatest.common as yc +DATA_DIR = os.path.join(os.path.dirname(yc.source_path(__file__)), "..", "data") --- contrib/python/google-auth/py3/tests/conftest.py (index) +++ contrib/python/google-auth/py3/tests/conftest.py (working tree) @@ -24,1 +24,2 @@ import pytest - pytest.data_dir = os.path.join(os.path.dirname(__file__), "data") + import yatest.common as yc + pytest.data_dir = os.path.join(os.path.dirname(yc.source_path("contrib/python/google-auth/py3/tests/conftest.py")), "data") --- contrib/python/google-auth/py3/tests/test__cloud_sdk.py (index) +++ contrib/python/google-auth/py3/tests/test__cloud_sdk.py (working tree) @@ -28,1 +28,2 @@ from google.auth import _cloud_sdk -DATA_DIR = os.path.join(os.path.dirname(__file__), "data") +import yatest.common as yc +DATA_DIR = os.path.join(os.path.dirname(yc.source_path(__file__)), "data") --- contrib/python/google-auth/py3/tests/test__default.py (index) +++ contrib/python/google-auth/py3/tests/test__default.py (working tree) @@ -38,1 +38,2 @@ from google.oauth2 import service_account -DATA_DIR = os.path.join(os.path.dirname(__file__), "data") +import yatest.common as yc +DATA_DIR = os.path.join(os.path.dirname(yc.source_path(__file__)), "data") --- contrib/python/google-auth/py3/tests/test__oauth2client.py (index) +++ contrib/python/google-auth/py3/tests/test__oauth2client.py (working tree) @@ -36,1 +36,2 @@ from six.moves import reload_module -DATA_DIR = os.path.join(os.path.dirname(__file__), "data") +import yatest.common as yc +DATA_DIR = os.path.join(os.path.dirname(yc.source_path(__file__)), "data") @@ -115,1 +116,1 @@ def mock_oauth2client_gae_imports(mock_non_existent_module): -def test__convert_appengine_app_assertion_credentials( +def _test__convert_appengine_app_assertion_credentials( @@ -165,1 +166,1 @@ def reset__oauth2client_module(): -def test_import_has_app_engine( +def _test_import_has_app_engine( --- contrib/python/google-auth/py3/tests/test__service_account_info.py (index) +++ contrib/python/google-auth/py3/tests/test__service_account_info.py (working tree) @@ -25,1 +25,2 @@ from google.auth import _service_account_info -DATA_DIR = os.path.join(os.path.dirname(__file__), "data") +import yatest.common as yc +DATA_DIR = os.path.join(os.path.dirname(yc.source_path(__file__)), "data") --- contrib/python/google-auth/py3/tests/test_identity_pool.py (index) +++ contrib/python/google-auth/py3/tests/test_identity_pool.py (working tree) @@ -41,1 +41,2 @@ SERVICE_ACCOUNT_IMPERSONATION_URL = ( -DATA_DIR = os.path.join(os.path.dirname(__file__), "data") +import yatest.common as yc +DATA_DIR = os.path.join(os.path.dirname(yc.source_path(__file__)), "data") --- contrib/python/google-auth/py3/tests/test_impersonated_credentials.py (index) +++ contrib/python/google-auth/py3/tests/test_impersonated_credentials.py (working tree) @@ -35,1 +35,2 @@ from google.auth.impersonated_credentials import Credentials -DATA_DIR = os.path.join(os.path.dirname(__file__), "", "data") +import yatest.common as yc +DATA_DIR = os.path.join(os.path.dirname(yc.source_path(__file__)), "data") --- contrib/python/google-auth/py3/tests/test_jwt.py (index) +++ contrib/python/google-auth/py3/tests/test_jwt.py (working tree) @@ -29,1 +29,2 @@ from google.auth import exceptions -DATA_DIR = os.path.join(os.path.dirname(__file__), "data") +import yatest.common as yc +DATA_DIR = os.path.join(os.path.dirname(yc.source_path(__file__)), "data") --- contrib/python/google-auth/py3/tests/oauth2/test_gdch_credentials.py (index) +++ contrib/python/google-auth/py3/tests/oauth2/test_gdch_credentials.py (working tree) @@ -29,4 +29,6 @@ import google.auth.transport.requests from google.oauth2.gdch_credentials import ServiceAccountCredentials +import yatest.common as yc + class TestServiceAccountCredentials(object): @@ -41,1 +43,1 @@ class TestServiceAccountCredentials(object): - os.path.dirname(__file__), "..", "data", "gdch_service_account.json" + os.path.dirname(yc.source_path(__file__)), "..", "data", "gdch_service_account.json" --- contrib/python/google-auth/py3/tests/test_pluggable.py (index) +++ contrib/python/google-auth/py3/tests/test_pluggable.py (working tree) @@ -29,1 +29,1 @@ import pytest # type: ignore -from tests.test__default import WORKFORCE_AUDIENCE +from .test__default import WORKFORCE_AUDIENCE --- contrib/python/google-auth/py3/tests/compute_engine/test__metadata.py (index) +++ contrib/python/google-auth/py3/tests/compute_engine/test__metadata.py (working tree) @@ -63,6 +63,7 @@ def make_request(data, status=http_client.OK, headers=None, retry=False): return request +@pytest.mark.xfail def test_detect_gce_residency_linux_success(): _metadata._GCE_PRODUCT_NAME_FILE = SMBIOS_PRODUCT_NAME_FILE assert _metadata.detect_gce_residency_linux() @@ -89,6 +90,7 @@ def test_is_on_gce_windows_success(): assert not _metadata.is_on_gce(request) +@pytest.mark.xfail @mock.patch("os.name", new="posix") def test_is_on_gce_linux_success(): request = make_request("", headers={_metadata._METADATA_FLAVOR_HEADER: "meep"}) --- contrib/python/google-auth/py3/tests/test__cloud_sdk.py (index) +++ contrib/python/google-auth/py3/tests/test__cloud_sdk.py (working tree) @@ -66,1 +66,1 @@ def test_get_project_id_call_error(check_output): -def test__run_subprocess_ignore_stderr(): +def _test__run_subprocess_ignore_stderr():