diff --git a/.chronus/changes/enable-skipped-python-tests-2026-4-8-8-47-0.md b/.chronus/changes/enable-skipped-python-tests-2026-4-8-8-47-0.md new file mode 100644 index 00000000000..61bc1bc01c1 --- /dev/null +++ b/.chronus/changes/enable-skipped-python-tests-2026-4-8-8-47-0.md @@ -0,0 +1,7 @@ +--- +changeKind: internal +packages: + - "@typespec/http-client-python" +--- + +Enable previously skipped client structure and client operation group mock API tests after TCGC 0.67.0 upgrade; remove obsolete `test_spread_record_discriminated_union` tests whose Spector scenario was removed. diff --git a/packages/http-client-python/tests/mock_api/azure/asynctests/test_client_structure_async.py b/packages/http-client-python/tests/mock_api/azure/asynctests/test_client_structure_async.py index fa58bd0f758..8d17c7a069d 100644 --- a/packages/http-client-python/tests/mock_api/azure/asynctests/test_client_structure_async.py +++ b/packages/http-client-python/tests/mock_api/azure/asynctests/test_client_structure_async.py @@ -38,7 +38,6 @@ async def test_structure_multiclient(): await client_b.renamed_six() -@pytest.mark.skip(reason="will reopen the cases after upgrade `@azure-tools/typespec-client-generator-core` to 0.67.0") @pytest.mark.asyncio async def test_structure_renamed_operation(): client = RenamedOperationClient(endpoint="http://localhost:3000", client=ClientType.RENAMED_OPERATION) @@ -46,19 +45,18 @@ async def test_structure_renamed_operation(): await client.renamed_three() await client.renamed_five() - await client.renamed_two() - await client.renamed_four() - await client.renamed_six() + await client.group.renamed_two() + await client.group.renamed_four() + await client.group.renamed_six() -@pytest.mark.skip(reason="will reopen the cases after upgrade `@azure-tools/typespec-client-generator-core` to 0.67.0") @pytest.mark.asyncio async def test_structure_two_operation_group(): client = TwoOperationGroupClient(endpoint="http://localhost:3000", client=ClientType.TWO_OPERATION_GROUP) - await client.one() - await client.three() - await client.four() + await client.group1.one() + await client.group1.three() + await client.group1.four() - await client.two() - await client.five() - await client.six() + await client.group2.two() + await client.group2.five() + await client.group2.six() diff --git a/packages/http-client-python/tests/mock_api/azure/asynctests/test_client_structure_clientoperationgroup_async.py b/packages/http-client-python/tests/mock_api/azure/asynctests/test_client_structure_clientoperationgroup_async.py index 0b3ba88d302..96f1157418b 100644 --- a/packages/http-client-python/tests/mock_api/azure/asynctests/test_client_structure_clientoperationgroup_async.py +++ b/packages/http-client-python/tests/mock_api/azure/asynctests/test_client_structure_clientoperationgroup_async.py @@ -8,24 +8,22 @@ from client.structure.clientoperationgroup.aio import FirstClient, SecondClient -@pytest.mark.skip(reason="will reopen the cases after upgrade `@azure-tools/typespec-client-generator-core` to 0.67.0") @pytest.mark.asyncio async def test_first_client_operations(): client = FirstClient(endpoint="http://localhost:3000", client=ClientType.CLIENT_OPERATION_GROUP) await client.one() - await client.two() - await client.three() + await client.group3.two() + await client.group3.three() - await client.four() + await client.group4.four() -@pytest.mark.skip(reason="will reopen the cases after upgrade `@azure-tools/typespec-client-generator-core` to 0.67.0") @pytest.mark.asyncio async def test_second_client_operations(): client = SecondClient(endpoint="http://localhost:3000", client=ClientType.CLIENT_OPERATION_GROUP) await client.five() - await client.six() + await client.group5.six() diff --git a/packages/http-client-python/tests/mock_api/azure/test_client_structure.py b/packages/http-client-python/tests/mock_api/azure/test_client_structure.py index e83d1ce6d6b..d28827376c0 100644 --- a/packages/http-client-python/tests/mock_api/azure/test_client_structure.py +++ b/packages/http-client-python/tests/mock_api/azure/test_client_structure.py @@ -3,7 +3,6 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -import pytest from client.structure.service.models import ClientType from client.structure.service import ServiceClient from client.structure.multiclient import ClientAClient, ClientBClient @@ -36,25 +35,23 @@ def test_structure_multiclient(): client_b.renamed_six() -@pytest.mark.skip(reason="will reopen the cases after upgrade `@azure-tools/typespec-client-generator-core` to 0.67.0") def test_structure_renamed_operation(): client = RenamedOperationClient(endpoint="http://localhost:3000", client=ClientType.RENAMED_OPERATION) client.renamed_one() client.renamed_three() client.renamed_five() - client.renamed_two() - client.renamed_four() - client.renamed_six() + client.group.renamed_two() + client.group.renamed_four() + client.group.renamed_six() -@pytest.mark.skip(reason="will reopen the cases after upgrade `@azure-tools/typespec-client-generator-core` to 0.67.0") def test_structure_two_operation_group(): client = TwoOperationGroupClient(endpoint="http://localhost:3000", client=ClientType.TWO_OPERATION_GROUP) - client.one() - client.three() - client.four() + client.group1.one() + client.group1.three() + client.group1.four() - client.two() - client.five() - client.six() + client.group2.two() + client.group2.five() + client.group2.six() diff --git a/packages/http-client-python/tests/mock_api/azure/test_client_structure_clientoperationgroup.py b/packages/http-client-python/tests/mock_api/azure/test_client_structure_clientoperationgroup.py index aa6d3c8a90d..3990830ebdb 100644 --- a/packages/http-client-python/tests/mock_api/azure/test_client_structure_clientoperationgroup.py +++ b/packages/http-client-python/tests/mock_api/azure/test_client_structure_clientoperationgroup.py @@ -3,27 +3,24 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -import pytest from client.structure.clientoperationgroup.models import ClientType from client.structure.clientoperationgroup import FirstClient, SecondClient -@pytest.mark.skip(reason="will reopen the cases after upgrade `@azure-tools/typespec-client-generator-core` to 0.67.0") def test_first_client_operations(): client = FirstClient(endpoint="http://localhost:3000", client=ClientType.CLIENT_OPERATION_GROUP) client.one() - client.two() - client.three() + client.group3.two() + client.group3.three() - client.four() + client.group4.four() -@pytest.mark.skip(reason="will reopen the cases after upgrade `@azure-tools/typespec-client-generator-core` to 0.67.0") def test_second_client_operations(): client = SecondClient(endpoint="http://localhost:3000", client=ClientType.CLIENT_OPERATION_GROUP) client.five() - client.six() + client.group5.six() diff --git a/packages/http-client-python/tests/mock_api/shared/asynctests/test_typetest_property_additionalproperties_async.py b/packages/http-client-python/tests/mock_api/shared/asynctests/test_typetest_property_additionalproperties_async.py index 3784156bfeb..3bded493a06 100644 --- a/packages/http-client-python/tests/mock_api/shared/asynctests/test_typetest_property_additionalproperties_async.py +++ b/packages/http-client-python/tests/mock_api/shared/asynctests/test_typetest_property_additionalproperties_async.py @@ -263,22 +263,6 @@ async def test_spread_model_array(client: AdditionalPropertiesClient): await client.spread_model_array.put(body) -@pytest.mark.skip(reason="https://github.com/microsoft/typespec/pull/6425") -@pytest.mark.asyncio -async def test_spread_record_discriminated_union(client: AdditionalPropertiesClient): - body = { - "name": "abc", - "prop1": {"fooProp": "abc", "kind": "kind0"}, - "prop2": { - "end": "2021-01-02T00:00:00Z", - "kind": "kind1", - "start": "2021-01-01T00:00:00Z", - }, - } - assert await client.spread_record_discriminated_union.get() == body - await client.spread_record_discriminated_union.put(body) - - @pytest.mark.asyncio async def test_spread_record_non_discriminated_union( client: AdditionalPropertiesClient, diff --git a/packages/http-client-python/tests/mock_api/shared/test_typetest_property_additionalproperties.py b/packages/http-client-python/tests/mock_api/shared/test_typetest_property_additionalproperties.py index 45445d9c425..c34c281f82f 100644 --- a/packages/http-client-python/tests/mock_api/shared/test_typetest_property_additionalproperties.py +++ b/packages/http-client-python/tests/mock_api/shared/test_typetest_property_additionalproperties.py @@ -236,21 +236,6 @@ def test_spread_model_array(client: AdditionalPropertiesClient): client.spread_model_array.put(body) -@pytest.mark.skip(reason="https://github.com/microsoft/typespec/pull/6425") -def test_spread_record_discriminated_union(client: AdditionalPropertiesClient): - body = { - "name": "abc", - "prop1": {"fooProp": "abc", "kind": "kind0"}, - "prop2": { - "end": "2021-01-02T00:00:00Z", - "kind": "kind1", - "start": "2021-01-01T00:00:00Z", - }, - } - assert client.spread_record_discriminated_union.get() == body - client.spread_record_discriminated_union.put(body) - - def test_spread_record_non_discriminated_union(client: AdditionalPropertiesClient): body = { "name": "abc",