Skip to main content

A Python package to facilitate writing tests for a testless code base.

Project description

postfix

A Python package to facilitate writing tests for a testless code base.

Installation

pip install --upgrade postfix

Usage

Suppose you have some tremendously complex code, but no tests for that code. But you are sufficiently convinced, that right now, it's working as it should. You want to do some refactoring, but you don't dare to do so without tests (wise decision!). So you decide to write tests a posteriori to make sure that after refactoring, the code works as before. Let's suppose that we want to create tests for the function myfunc and the method MyClass.mymethod (see example/state_1). And let's suppose that it is complicated to get realistic data for the arguments of that function/method. In order to quickly get a first test coverage with realistic input and output data, we will use postfix to create test fixtures. Annotate the function or method for which you create a fixture with the decorator postfix.create_fixture (see example/state2) and run your code. Remove the decorators from the production code, move the dumped fixture files to your newly created test suite directory and use them to write tests (see examples/state_3).

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

postfix-0.0.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

postfix-0.0.1-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file postfix-0.0.1.tar.gz.

File metadata

  • Download URL: postfix-0.0.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.2

File hashes

Hashes for postfix-0.0.1.tar.gz
Algorithm Hash digest
SHA256 68520b9e3e72e601d57ec116c637d58198ad32d702337375a522e061b90f72e8
MD5 d2b5ff03dbcc7f54e076aa2887baf77f
BLAKE2b-256 b68670c45e3a739e69bb0b0240bc56dbec6c0015197a4a25907cf720871a0af9

See more details on using hashes here.

File details

Details for the file postfix-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: postfix-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.2

File hashes

Hashes for postfix-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a6491ae2b2ef9f914b24ed9d6a4c3ffd1cd5eb7108927ba42cb60030d3ae1033
MD5 a1e192b86b905e8df9ba118879f41d17
BLAKE2b-256 a8142e5ff4e1be2b3a02da6c6634402ad7e65042de875a57f158b57f654476a2

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