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.6.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

flask_fixture-0.0.6-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for flask_fixture-0.0.6.tar.gz
Algorithm Hash digest
SHA256 7883e3e9be4f284b095863cc8076e56c1f2f2ed8bbf8fc392e31041ee2260187
MD5 e57ba3439d8560095df7f42476ec8898
BLAKE2b-256 ca7fa989b185842415275dfb17b93cfca5c487f39886c8b9742978df8d729653

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flask_fixture-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 3bdad89077d5c14dbf6505026ee9942b5a7b3b42ec33e8a8a9ea35ecf5e80f6b
MD5 0d720ee69aaa3ba26c7fd19b5e7a6ae5
BLAKE2b-256 79af5b79bed2d932b81a1863d4525330930ac30d05fea30bd493cf3a47e41508

See more details on using hashes here.

Supported by

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