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.0.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.0-py3-none-any.whl (45.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fixtup-0.2.0.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.0.tar.gz
Algorithm Hash digest
SHA256 8e735751a3f7f57982bfa26f74dd939b4f14125ba31bad4085cd06d7c93aed75
MD5 486b2fdb7e8f48e9054689fda47d68f6
BLAKE2b-256 160033fe81cffffb5b312e6c06201e1368ac01d65305bb85106b897e3f951afd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fixtup-0.2.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 54d4800effb7af76cec0b192b17dbe74384654022d5ee8232a292de44a256bea
MD5 eac5f3f2b29f34c8f2d0aaee38070ea0
BLAKE2b-256 0433485e910cc79b0c3d481b9ac83a2dca593df118f4a3ee41161951833274c4

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