Skip to main content

No project description provided

Project description

Maintenance Code Style License: MIT

pytest-builtin-types

pytest-builtin-types gives you prebuilt builtin data types for testing your own projects.

Key Features:

  • Basic Types: Has a selection of fixtures with pre-built types such as float, int, str, etc.
  • Basic Containers: Has a selection of fixtures with pre-built containers such as dict, list, tuple etc.
  • Great Developer Experience: Being fully typed makes it great for editor support.

Installation

pip install pytest-builtin-types

Example

Basic Type

def test_float_type(float_1, float_2):
    print(float_1) # 1.1
    print(float_2) # 2.1

Basic Types

def test_basic_types(basic_types_1, basic_types_2):
    print(basic_types_1) # {<class 'str'>: 'string1', <class 'int'>: 1, <class 'float'>: 1.1}
    print(basic_types_2) # {<class 'str'>: 'string2', <class 'int'>: 2, <class 'float'>: 1.2}

Basic Containers

def test_container_types(basic_containers_1):
    print(basic_containers_1) 
    # {<class 'list'>: ['string1', 1, 1.1], <class 'tuple'>: ('string1', 1, 1.1), <class 'set'>: {1, 'string1', 1.1},
    # <class 'dict'>: {<class 'str'>: 'string1', <class 'int'>: 1, <class 'float'>: 1.1}}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-builtin-types-1.2.tar.gz (4.1 kB view hashes)

Uploaded source

Built Distribution

pytest_builtin_types-1.2-py3-none-any.whl (4.5 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page