Skip to content

Examples#

Index > MainframeModernizationApplicationTesting > Examples

Auto-generated documentation for MainframeModernizationApplicationTesting type annotations stubs module mypy-boto3-apptest.

Client#

Implicit type annotations#

Can be used with boto3-stubs[apptest] package installed.

Write your MainframeModernizationApplicationTesting code as usual, type checking and code completion should work out of the box.

# MainframeModernizationApplicationTestingClient usage example

from boto3.session import Session


session = Session()

client = session.client("apptest")  # (1)
result = client.create_test_case()  # (2)
  1. client: MainframeModernizationApplicationTestingClient
  2. result: CreateTestCaseResponseTypeDef
# ListTestCasesPaginator usage example

from boto3.session import Session


session = Session()
client = session.client("apptest")  # (1)

paginator = client.get_paginator("list_test_cases")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: MainframeModernizationApplicationTestingClient
  2. paginator: ListTestCasesPaginator
  3. item: ListTestCasesResponseTypeDef

Explicit type annotations#

With boto3-stubs-lite[apptest] or a standalone mypy_boto3_apptest package, you have to explicitly specify client: MainframeModernizationApplicationTestingClient type annotation.

All other type annotations are optional, as types should be discovered automatically. However, these type annotations can be helpful in your functions and methods.

# MainframeModernizationApplicationTestingClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_apptest.client import MainframeModernizationApplicationTestingClient
from mypy_boto3_apptest.type_defs import CreateTestCaseResponseTypeDef
from mypy_boto3_apptest.type_defs import CreateTestCaseRequestRequestTypeDef


session = Session()

client: MainframeModernizationApplicationTestingClient = session.client("apptest")

kwargs: CreateTestCaseRequestRequestTypeDef = {...}
result: CreateTestCaseResponseTypeDef = client.create_test_case(**kwargs)
# ListTestCasesPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_apptest.client import MainframeModernizationApplicationTestingClient
from mypy_boto3_apptest.paginator import ListTestCasesPaginator
from mypy_boto3_apptest.type_defs import ListTestCasesResponseTypeDef


session = Session()
client: MainframeModernizationApplicationTestingClient = session.client("apptest")

paginator: ListTestCasesPaginator = client.get_paginator("list_test_cases")
for item in paginator.paginate(...):
    item: ListTestCasesResponseTypeDef
    print(item)