Package tlib :: Package base :: Module PytestTester |
[hide private]
[frames] | no frames]

# Source Code for Module tlib.base.PytestTester

     1  import pytest
     2  from TestHelper import Singleton
     3
     4  # noinspection PyMethodParameters
     5  # noinspection PyUnresolvedReferences
     6 -class PytestTester(object):
     7      __metaclass__ = Singleton
     8
     9      @pytest.fixture(scope='function', autouse=True)
    10 -    def log(self, request, test_logger):
    11          test_logger.info("======================== START %s ========================" % request.keywords.node.name)
    12
    13          def log_end():
    14              test_logger.info("======================== END %s ========================"  % request.keywords.node.name)
    15
    16          request.addfinalizer(log_end)
    17
    18
    19      @pytest.fixture(scope='class', autouse=True)
    20 -    def initialize_pytest_class(self, request, test_logger, tlib_logger):
    21          """    test_logger \= None\n    tlib_logger \= None
    22          @type test_logger: logging
    23          @type tlib_logger: logging
    24          @type request: FixtureRequest
    25          """
    26          #Store an instance of browser and loggers to be used from code that doesn't have access to this information
    27          setattr(PytestTester, 'test_logger', test_logger)
    28          setattr(PytestTester, 'tlib_logger', tlib_logger)
    29