Skip to main content

Start and stop the flask server for your tests

Project description

logo

Downloads Downloads codecov Test-Package Python versions PyPI version

A simple plugin for Pytest containing a fixture that can start and stop the Flask server to run related tests. You just have to define the routes.

Install it by the command:

pip install flask_fixture

Define some routes in your conftest.py file:

from flask_fixture import endpoint

@endpoint('/')
def root():
    return 'some text'

And use a URL of a server in your tests as a fixture local_server_url:

import requests

def test_server(local_server_url):
    assert requests.get(local_server_url).text == 'some text'

The example uses the Requests library.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

flask_fixture-0.0.4-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file flask_fixture-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: flask_fixture-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 14.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for flask_fixture-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f474472dcd54e63e50d5f33c6f27411c689ffca48643c89c45213a3e6aa085d0
MD5 e5a004e36b1adf1aac0582d8096de105
BLAKE2b-256 ad256e69f24629964b511b3e9a34b5704bb46d1228be278bf083d2ebd9fb1c00

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