Skip to content

jeremad/tavern-flask

 
 

Repository files navigation

Tavern flask plugin

YAML configuration

The test definition looks like this:

---
test_name: Test example
flask:
  app:
    location: flask_module
stages:
  - name: Test example
    request:
      url: "http://localhost:5000/example"
      method: GET
    response:
      status_code: 200

This assumes that: flask_module is a python module that implements the function create_app().

Using poetry

  1. Add the tavern plugin as a dev dependency;
$ poetry add --group dev git+https://github.com/jeremad/tavern-flask.git
  1. Use this plugin as the HTTP entrypoint.
  • In pyproject.toml:
[tool.poetry.plugins."tavern_http"]
"flask" = "tavern_flask.tavernhook"
  • In the pytest command line:
$ poetry run pytest --tavern-http-backend=flask

About

WIP for a tavern flask plugin

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%