Skip to main content

Start and stop the flask server for your tests

Project description

logo

Downloads Downloads codecov Hits-of-Code Tests Python versions PyPI version Checked with mypy Ruff

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 Distribution

flask_fixture-0.0.7.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

flask_fixture-0.0.7-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file flask_fixture-0.0.7.tar.gz.

File metadata

  • Download URL: flask_fixture-0.0.7.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for flask_fixture-0.0.7.tar.gz
Algorithm Hash digest
SHA256 2e639a3fa9600cca719e858e4935638661bca3eb56dd3577bc9f974c0760d29a
MD5 73ff25d4b87dfc80f32193c0908fe47b
BLAKE2b-256 3dc2ac7231d2214a201e4823872c0f14bd3acf89067deb4ee97e25c87708396d

See more details on using hashes here.

Provenance

The following attestation bundles were made for flask_fixture-0.0.7.tar.gz:

Publisher: release.yml on pomponchik/flask_fixture

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: flask_fixture-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for flask_fixture-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 1749f9cfb190b25dc93ebec1877eda07a92c6ddb398cb326c655628654012673
MD5 973439b75750446c8bea0885e8b3f39b
BLAKE2b-256 0bb26c151f16fc93aa450ab2f5062d756d5980d28374425a4fc998d6b2f66882

See more details on using hashes here.

Provenance

The following attestation bundles were made for flask_fixture-0.0.7-py3-none-any.whl:

Publisher: release.yml on pomponchik/flask_fixture

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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