Skip to main content

integration testing on steroids

Project description

Fixtup

Test your python application beyond your code !

version ci MIT

Fixtup manages disposable environments & data for your tests

write clear, robust and easy-to-execute system integration tests with your favorite test framwork like pytest, unittest or event BDD framework as robot framework or behave.

  • it starts the services needed to run your test
  • it mount the longest fixtures only once whether you play a test or 100
  • it cleans files and data between each test
  • it runs on a developer's workstation without configuration
  • it can be debugged step by step in your favorite IDE

Benefits

  • You can get up and running with Fixtup in minutes, even on legacy project, no matter what your test framework is.
  • You will stop wasting your time on boilerplate code
  • Fixtup provides an easy way to run tests in debug in your favorite IDE like pycharm and vscode.
  • Fixtup is cross-platform which makes it easy to use it on Linux, Mac and Windows.

Getting started

write clear, robust and easy-to-execute system integration tests in 5 minutes.

$ poetry init
$ poety add --dev fixtup
$ poetry run fixtup init
$ poetry run fixtup new
Choose a fixture identifier : thumbnail_context
Mount environment variables on this fixture (y/n) [n]
Mount docker container on this fixture (y/n) [n]

We will use this fixture to mount a directory with existing picture file.png and test our thumbnail function is working well.

def test_thumbnail_should_generate_thumbnail(self):

    # Magic happens with the instruction fixtup.up
    with fixtup.up('thumbnail_context') as f:
        # Given
        wd = os.getcwd()
        original_file = os.directory.join(wd, 'file.png')
        expected_thumbnail_file = os.directory.join(wd, 'file_t.png')

        # Then
        thumbnail(original_file, expected_thumbnail_file)

        # Then
        self.assertTrue(os.directory.isfile(expected_thumbnail_file)

Fixtup mount the fixture thumbnail_context in temporary directory. At the end of the test, it clean up everything for you Want more ? Fixtup even mount your containers, take a try.

The complete example is available in the repo

Installation

Using pip

pip install fixtup

Using Poetry (recommended for development)

poetry add --group dev fixtup

Development Setup

This project uses Poetry for dependency management and packaging.

Prerequisites

  • Python 3.10 or higher
  • Poetry

Setup

# Clone the repository
git clone https://github.com/FabienArcellier/fixtup.git
cd fixtup

# Install dependencies
poetry install

# Activate the virtual environment
poetry shell

Running Tests

# Run all tests
poetry run alfred tests

# Run specific test suites
poetry run alfred tests:units
poetry run alfred tests:integrations
poetry run alfred tests:acceptances

Linting

poetry run alfred lint

Building Documentation

poetry run alfred docs:build
poetry run alfred docs:display

Contributing

More information into CONTRIBUTING.md

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

fixtup-0.2.1.tar.gz (26.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fixtup-0.2.1-py3-none-any.whl (45.8 kB view details)

Uploaded Python 3

File details

Details for the file fixtup-0.2.1.tar.gz.

File metadata

  • Download URL: fixtup-0.2.1.tar.gz
  • Upload date:
  • Size: 26.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.12.12 Linux/6.14.0-1017-azure

File hashes

Hashes for fixtup-0.2.1.tar.gz
Algorithm Hash digest
SHA256 e5bc4317ee87046036fd3b0f2fbe656beb4905bf9f56e22192b94a48535e0fdf
MD5 4ed827b28e34b6f0c07d17f9e05fc690
BLAKE2b-256 50e75ff3596bdde51a2c8ae236745b02db5a63245eaaa1aab6428d15d3200f28

See more details on using hashes here.

File details

Details for the file fixtup-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: fixtup-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 45.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.12.12 Linux/6.14.0-1017-azure

File hashes

Hashes for fixtup-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5834d6a80c89559b49d1d3e444833aaa62b3aac89079de1618b750f81b692d8b
MD5 4b5f460cf1e927aa88ae13dd4d4a510e
BLAKE2b-256 eb78ae0af65096ecae70ea58a72c7273b150de032fd7c5cbb2d8e388709803fe

See more details on using hashes here.

Supported by

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