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

# Source Code for Module tlib.base.PytestTester

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