Skip to main content

Package that makes e2e tests easy.

Project description

Stickybeak is an end to end test helper library that saves lots of testing endpoints and boilerplate code. Usually end to end testing is hard to debug when something goes wrong since modern microservice architecture can be quite convoluted. This library can flatten structure of even the most complex application and help developers write tests that are easy to debug and reflect real life scenarios.

This can save Hundreds of unit and integration tests.

How does it work

Stickybeak uses code injection to execute arbitrary python code on remote servers in a local environment or dedicated centralized testing microservice. Code injection might sound scary but this solution is completely safe since code injection endpoints are only enabled in testing or staging environment. Results of executed code including all local variables or raised exceptions are pickled on remote server and sent back to the testing script where are unpickled and available for further testing and debugging - just like the code was executed locally.

Pretty amazing huh :) ?

At the moment stickybeak supports Django and Flask frameworks.


pip install stickybeak

Example usage

Django app (remote server)

To enable stickybeak in a django application add the following line to your file:

path("stickybeak/", include("")),

And add stickybeak to INSTALLED_APPS list.

Flask app (remote server)

To enable stickybeak in a flask application add setup(app) as follows:

from flask import Flask
from stickybeak.flask_view import setup

app = Flask(__name__)

Testing app (local server)


Function arguments and returns as well as default arguments are allowed.

from stickybeak.injector import DjangoInjector

injector = DjangoInjector(address='http://django-srv:8000',

def fun(a: int, b: int = 2) -> float:
    return a / b



Exception are forwarded from remote to local server so the following piece of code raises ZeroDivisionError:

from stickybeak.injector import DjangoInjector

injector = DjangoInjector(address='http://django-srv:8000',

def fun() -> float:
    a = 1
    b = 0
    return a / b

fun()  # raises ZeroDivisionError

Using complex objects from a remote server locally

Objects are pickled on the remote side and send back to the local script and are available for further inspection or use.

def fun():
    from app.models import Currency

    currency = Currency() = "test_currency"
    currency.endpoint = "test_endpoint"
    return Currency.objects.all()[0]  # noqa

ret: object = fun()
assert == "test_currency"
assert ret.endpoint == "test_endpoint"


The same concepts go to classes. Only classmethods are allowed at the moment.

class Interface:
    def fun(cls, x: int) -> int:
        a = 1
        b = 2
        return a + b + x

    def fun2(cls, x: int) -> int:
        c = 3
        d = 4
        return c + d + x

    def fun3(cls) -> int:
        return + cls.fun2(x=5)  # 4
Interface.fun2(2)  # 9
Interface.fun3() # 20


Stickybeak uses pipenv. To install packages run:

pipenv install

Starting test servers

honcho start

Project details

Download files

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

Files for stickybeak, version 0.4.9
Filename, size File type Python version Upload date Hashes
Filename, size stickybeak-0.4.9-py3-none-any.whl (13.6 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size stickybeak-0.4.9.tar.gz (38.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page