switch to pytest test runner for better testing experience

This commit is contained in:
Anatoly Bubenkov 2015-02-28 13:10:29 +01:00
commit 869a12c748
287 changed files with 58 additions and 26 deletions

2
.gitignore vendored
View file

@ -10,6 +10,8 @@ dist
tags
.tox
.coverage
/.env
/.cache
htmlcov
six-*.egg/
*.orig

View file

@ -1,7 +1,9 @@
language: python
env:
- TESTENV=py27
- TESTENV=py33
- TESTENV=py34
python:
- "2.7"
- "3.3"
- "3.4"
addons:
apt_packages:
@ -10,10 +12,12 @@ before_install:
- sudo apt-get update -qq
- sudo locale-gen fr_FR.UTF-8 tr_TR.UTF-8
install:
- pip install .
- pip install -r dev_requirements.txt
- pip install nose-cov
script: nosetests -sv --with-coverage --cover-package=pelican pelican
- pip install python-coveralls
- pip install -U virtualenv py
- pip install -e . -r dev_requirements.txt tox
script:
- tox
- py.test --cov=pelican --cov-report=term-missing tests
after_success:
# Report coverage results to coveralls.io
- pip install coveralls

13
Makefile Normal file
View file

@ -0,0 +1,13 @@
# create virtual environment
PYTHON = python2.7
.env:
virtualenv .env -p $(PYTHON)
# install all needed for development
develop: .env
.env/bin/pip install -e . -r dev_requirements.txt tox
# clean the development envrironment
clean:
-rm -rf .env

View file

@ -1,5 +1,8 @@
# Tests
mock
pytest
pytest-cache
pytest-cov
# Optional Packages
Markdown

View file

@ -1,6 +1,11 @@
Release history
###############
Unreleased
==========
* Switch to pytest test runner.
3.5.0 (2014-11-04)
==================

View file

@ -66,10 +66,13 @@ Each time you add a feature, there are two things to do regarding tests:
check that the existing tests pass, and add tests for the new feature
or bugfix.
The tests live in ``pelican/tests`` and you can run them using the
"discover" feature of ``unittest``::
The tests live in ``tests`` and you can run them using the ``pytest``runner::
$ python -m unittest discover
$ py.test tests
For full multipython testing, use ``tox``::
$ tox
After making your changes and running the tests, you may see a test failure
mentioning that "some generated files differ from the expected functional tests
@ -78,11 +81,11 @@ Pelican, and the changes to that output are expected and deemed correct given
the nature of your changes, then you should update the output used by the
functional tests. To do so, you can use the following two commands::
$ LC_ALL=en_US.utf8 pelican -o pelican/tests/output/custom/ \
$ LC_ALL=en_US.utf8 pelican -o tests/output/custom/ \
-s samples/pelican.conf.py samples/content/
$ LC_ALL=fr_FR.utf8 pelican -o pelican/tests/output/custom_locale/ \
$ LC_ALL=fr_FR.utf8 pelican -o tests/output/custom_locale/ \
-s samples/pelican.conf_FR.py samples/content/
$ LC_ALL=en_US.utf8 pelican -o pelican/tests/output/basic/ \
$ LC_ALL=en_US.utf8 pelican -o tests/output/basic/ \
samples/content/
Testing on Python 2 and 3

View file

@ -45,5 +45,4 @@ setup(
'Topic :: Internet :: WWW/HTTP',
'Topic :: Software Development :: Libraries :: Python Modules',
],
test_suite='pelican.tests',
)

View file

Before

Width:  |  Height:  |  Size: 751 B

After

Width:  |  Height:  |  Size: 751 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 958 B

After

Width:  |  Height:  |  Size: 958 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 202 B

After

Width:  |  Height:  |  Size: 202 B

Before After
Before After

Some files were not shown because too many files have changed in this diff Show more