Skip to main content

Generates pytest fixtures that allow the use of type hinting

Project description

pytest-factoryboy-fixtures

Writes pytest fixtures for FactoryBoy with type hinting. The hints allow for proper code completion in your tests when using PyCharm.

Usage

pytest-factoryboy-fixtures [comma seperated class names]

Add the generated code to your conftest.py.

Example

>>> pytest-factoryboy-fixtures FirstClass,SecondClass

    @fixture
    def first_class() -> FirstClass:
        return FirstClassFactory()
        
        
    @fixture
    def first_class_factory() -> Union[Type[FirstClass], Type[FirstClassFactory]]:
        return FirstClassFactory
        
        
    @fixture
    def second_class() -> SecondClass:
        return SecondClassFactory()
        
        
    @fixture
    def second_class_factory() -> Union[Type[SecondClass], Type[SecondClassFactory]]:
        return SecondClassFactory

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

pytest-factoryboy-fixtures-0.1.tar.gz (3.4 kB view details)

Uploaded Source

File details

Details for the file pytest-factoryboy-fixtures-0.1.tar.gz.

File metadata

  • Download URL: pytest-factoryboy-fixtures-0.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2

File hashes

Hashes for pytest-factoryboy-fixtures-0.1.tar.gz
Algorithm Hash digest
SHA256 c228f8d40e2811c04d0210cc9f008aeb42c1d1946877dcbfccca80c38023ec63
MD5 dd4af0c72ecb48034f9beb7afa3ca532
BLAKE2b-256 40da0d311bc656cfc301b4cdf6f0af03f6c80339d23418c7e0baf2d13585604e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page