view _ui_tests/ @ 2595:43f68139d90e

fix html validation errors when TOC level is specified
author RogerHaase <>
date Sat, 03 May 2014 12:45:32 -0700
parents 181a556a0920
line wrap: on
line source
# Copyright: 2012 MoinMoin:HughPerkins
# License: GNU GPL v3 (or any later version), see LICENSE.txt for details.

Contains events called by py.test during the life-cycle of the test suite
This module is automatically loaded by py.test, which looks for a file
of this name

import os
import sys

import driver_register

def pytest_runtest_makereport(item, call):
    Entry point for event which occurs after each test has run
    The parameters are:
    - item: the method called
    - call: an object of type CallInfo, which has two properties, of which
      excinfo contains info about any exception that got thrown by the method
    This method is called automatically by py.test.  The name of the method
    is used by py.test to locate it, and decide when to call it
    This specific method instance is used to take a screenshot whenever a test
    fails, ie whenever the method throws an exception
    if call.excinfo is not None:
        if driver_register.get_driver() is not None and hasattr(item, 'obj'):
                unicode(item.obj).split(u" ")[2] + u'.png')