Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

First commit

  • Loading branch information...
commit 6fa32ecddb7d5d83a04be27de597b292a695c276 0 parents
Leonardo Santagada authored
5 .gitignore
... ... @@ -0,0 +1,5 @@
  1 +*.pyc
  2 +*.pyo
  3 +*.egg-info
  4 +dist
  5 +
2  MANIFEST.in
... ... @@ -0,0 +1,2 @@
  1 +include *.txt
  2 +include *.rst
23 README.rst
Source Rendered
... ... @@ -0,0 +1,23 @@
  1 +pytest plugin to implement PEP712
  2 +
  3 +Usage
  4 +-----
  5 +
  6 +install/update via::
  7 +
  8 + pip install -U pytest-rage
  9 +
  10 +and to run tests type::
  11 +
  12 + py.test
  13 +
  14 +if more than 7 tests fails fffffffuuuuu happens :)
  15 +
  16 +Notes
  17 +-----
  18 +
  19 +The official repository of this plugin is at http://github.com/santagada/pytest-rage
  20 +
  21 +For more info on py.test see http://pytest.org
  22 +
  23 +Based on PEP712: http://www.revsys.com/blog/2011/oct/20/pep712-proposal-make-unittest2-more-accurate/
22 pytest_rage.py
... ... @@ -0,0 +1,22 @@
  1 +import pytest
  2 +
  3 +test_count = 0
  4 +
  5 +def pytest_report_teststatus(report):
  6 + global test_count
  7 + if report.passed:
  8 + letter = "."
  9 + elif report.skipped:
  10 + letter = "s"
  11 + elif report.failed:
  12 + test_count += 1
  13 + if test_count > 7:
  14 + letter = "U"
  15 + else:
  16 + letter = "F"
  17 + if report.when != "call":
  18 + if test_count > 7:
  19 + letter = "u"
  20 + else:
  21 + letter = "f"
  22 + return report.outcome, letter, report.outcome.upper()
29 setup.py
... ... @@ -0,0 +1,29 @@
  1 +import os
  2 +from setuptools import setup
  3 +
  4 +# Utility function to read the README file.
  5 +# Used for the long_description. It's nice, because now 1) we have a top level
  6 +# README file and 2) it's easier to type in the README file than to put a raw
  7 +# string in below ...
  8 +def read(fname):
  9 + return open(os.path.join(os.path.dirname(__file__), fname)).read()
  10 +
  11 +setup(
  12 + name='pytest-rage',
  13 + license='MIT',
  14 + description='pytest plugin to implement PEP712',
  15 + long_description=read("README.rst"),
  16 + version='0.1',
  17 + author='Leonardo Santagada',
  18 + author_email='santagada@gmail.com',
  19 + url='http://github.com/santagada/pytest-rage/',
  20 + py_modules=['pytest_rage'],
  21 + entry_points={'pytest11': ['rage = pytest_rage']},
  22 + install_requires=['pytest>=2.0'],
  23 + classifiers=[
  24 + 'Development Status :: 3 - Alpha',
  25 + 'Topic :: Software Development :: Testing',
  26 + 'Intended Audience :: Developers',
  27 + 'Operating System :: OS Independent',
  28 + ]
  29 +)
6 test_rage.py
... ... @@ -0,0 +1,6 @@
  1 +def test_error():
  2 + assert False
  3 +
  4 +def pytest_generate_tests(metafunc):
  5 + for i in range(10):
  6 + metafunc.addcall()

0 comments on commit 6fa32ec

Please sign in to comment.
Something went wrong with that request. Please try again.