Python tests unitaires

Voir aussi:

unittest (moins pratique que pytest)

https://medium.com/python-in-plain-english/unit-testing-in-python-tox-and-nox-833e4bbce729

Source : http://sametmax.com/un-gros-guide-bien-gras-sur-les-tests-unitaires-en-python-partie-3/

#pip3 install pytest apt-get install python3-pytest

Voir aussi : Testinfra

#! /usr/bin/python3 # coding: utf-8 #import pytest from func import plop def test_plop(): assert foo == bar
pytest-3

Autre

#!/bin/bash TOP_DIR=$(dirname $(realpath "$0")) cd $TOP_DIR/test/unit nosetests --exe --with-coverage --cover-package swift --cover-erase --cover-branches --cover-html --cover-html-dir="$TOP_DIR"/cover $@ rvalue=$? rm -f .coverage cd - exit $rvalue

$ dpkg -S /usr/bin/nosetests
python-nose: /usr/bin/nosetests