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 Distribution

flask_fixture-0.0.5.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

flask_fixture-0.0.5-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: flask_fixture-0.0.5.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.7

File hashes

Hashes for flask_fixture-0.0.5.tar.gz
Algorithm Hash digest
SHA256 0c7e84ee1612e518ce06874aa4da3210981d57545450bc0aee748911bf289d0c
MD5 88e320fee39c50de5b327b9cfae5c90b
BLAKE2b-256 175fe6fa64dedcb51db1cf2a71b56078d6d03cffbbf9c61abb14c12c43e2bde2

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for flask_fixture-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 13c408822239dff57db977f007af8089d187e928924842c01081b5b317154388
MD5 f3a8ef28f9ade5147af98c2078ce6648
BLAKE2b-256 26cd4add04bf3ec56db55e732dc458d26737318a316db70b76899e07680e8424

See more details on using hashes here.

Supported by

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