-
-
Tavern is a PYTEST PLUGIN, command-line tool and Python library for automated testing of APIs, with a simple, concise and flexible YAML-BASED SYNTAX. It’s very simple to get started, and highly customisable for complex tests.
所謂 pytest plugin 是指會自動找
test_*.tavern.yaml
來當 test case,但就 "highly customisable for complex tests" 這點我是存疑的,畢竟 Tavern 發展出一層專用的 DSL,所謂 "highly customisable for complex tests" 指的就是開發 Tavern plugin 吧? -
Tavern supports testing RESTful APIs as well as MQTT based APIs.
-
The best way to use Tavern is with pytest. Tavern comes with a pytest plugin so that literally all you have to do is install pytest and Tavern, write your tests in
.tavern.yaml
files and run pytest. This means you get access to all of the pytest ecosystem and allows you to do all sorts of things like regularly run your tests against a test server and report failures or generate HTML reports. -
You can also integrate Tavern into your own test framework or continuous integration setup using the Python library, or use the command line tool,
tavern-ci
with bash scripts and cron jobs. ?? -
To learn more, check out the examples or the complete documentation. If you’re interested in contributing to the project take a look at the GitHub repo.
-
文件: