view _ui_tests/ @ 2915:0b30aa1fa138

fixes #496 Password checker bypassed when user resets password
author Yask Srivastava <>
date Sat, 28 Feb 2015 23:58:11 -0800
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')