Outils pour utilisateurs

Outils du site


tech:python_tests_unitaires

Ceci est une ancienne révision du document !


Python tests unitaires

Voir aussi:

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

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

Autre

~/swift/.unittests
#!/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
tech/python_tests_unitaires.1742825205.txt.gz · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki