This commit is contained in:
holger krekel 2013-07-06 16:03:48 +02:00
commit 31421cb6d7
6 changed files with 79 additions and 14 deletions

32
.gitignore vendored Normal file
View File

@ -0,0 +1,32 @@
# Automatically generated by `hgimportsvn`
.svn
.hgsvn
# Ignore local virtualenvs
lib/
bin/
include/
.Python/
# These lines are suggested according to the svn:ignore property
# Feel free to enable them by uncommenting them
*.pyc
*.pyo
*.swp
*.html
*.class
*.orig
*~
doc/*/_build
build/
dist/
*.egg-info
issue/
env/
3rdparty/
.tox
.cache
.coverage
.ropeproject

10
.travis.yml Normal file
View File

@ -0,0 +1,10 @@
language: python
# command to install dependencies
install: "pip install -e . detox"
# # command to run tests
script: detox --recreate
notifications:
irc:
- "chat.freenode.net#pylib"
email:
- pytest-commit@python.org

View File

@ -16,6 +16,9 @@ scales to support complex functional testing. It provides
- many `external plugins <http://pytest.org/latest/plugins.html#installing-external-plugins-searching>`_. - many `external plugins <http://pytest.org/latest/plugins.html#installing-external-plugins-searching>`_.
.. image:: https://secure.travis-ci.org/bubenkoff/pytest.png?branch=travis-integration
:target: http://travis-ci.org/bubenkoff/pytest
A simple example for a test:: A simple example for a test::
# content of test_module.py # content of test_module.py

View File

@ -462,6 +462,10 @@ class TerminalReporter:
else: else:
markup['green'] = True markup['green'] = True
self.write_sep("=", msg, **markup) self.write_sep("=", msg, **markup)
if self.verbosity == -1:
if line:
self.write("%s, " % line)
self.write("time: %.2f seconds\n" % session_duration)
#else: #else:
# self.write_line(msg, bold=True) # self.write_line(msg, bold=True)

View File

@ -473,6 +473,17 @@ class TestTerminalFunctional:
assert 'test session starts' not in s assert 'test session starts' not in s
assert p1.basename not in s assert p1.basename not in s
assert "===" not in s assert "===" not in s
assert "passed" in s
def test_more_quiet_reporting(self, testdir):
p1 = testdir.makepyfile("def test_pass(): pass")
result = testdir.runpytest(p1, '-qq')
s = result.stdout.str()
assert 'test session starts' not in s
assert p1.basename not in s
assert "===" not in s
assert "passed" not in s
def test_fail_extra_reporting(testdir): def test_fail_extra_reporting(testdir):
p = testdir.makepyfile("def test_this(): assert 0") p = testdir.makepyfile("def test_this(): assert 0")

View File

@ -13,6 +13,10 @@ deps=
changedir=. changedir=.
commands= py.test --genscript=pytest1 commands= py.test --genscript=pytest1
[testenv:py25]
setenv =
PIP_INSECURE=1
[testenv:py27-xdist] [testenv:py27-xdist]
changedir=. changedir=.
basepython=python2.7 basepython=python2.7
@ -29,6 +33,7 @@ basepython=python2.7
deps=pytest-xdist deps=pytest-xdist
setenv= setenv=
PYTHONDONTWRITEBYTECODE=1 PYTHONDONTWRITEBYTECODE=1
distribute=true
commands= commands=
py.test -n3 -rfsxX \ py.test -n3 -rfsxX \
--junitxml={envlogdir}/junit-{envname}.xml {posargs:testing} --junitxml={envlogdir}/junit-{envname}.xml {posargs:testing}