Exemple #1
0
    def __init__(
        self,
        cover_packages,
        cover_append,
        cover_config_file,
        cover_branches,
        cover_erase,
        cover_min_percentage,
        cover_html,
        cover_xml,
    ):
        try:
            from coverage import Coverage  # noqa
        except ImportError:
            raise RadishError(
                "if you want to use the code coverage extension you have to "
                "'pip install radish-bdd[coverage]'")

        self.cover_packages = cover_packages
        self.cover_append = cover_append
        self.cover_config_file = cover_config_file
        self.cover_branches = cover_branches
        self.cover_erase = cover_erase
        self.cover_min_percentage = cover_min_percentage
        self.cover_html = cover_html
        self.cover_xml = cover_xml

        before.all()(self.coverage_start)
        after.all()(self.coverage_stop)

        self.coverage = None
        self.modules_on_init = set(sys.modules.keys())
Exemple #2
0
 def __init__(self):
     before.all(self.syslog_writer_before_all)
     before.each_feature(self.syslog_writer_before_each_feature)
     before.each_scenario(self.syslog_writer_before_each_scenario)
     before.each_step(self.syslog_writer_before_each_step)
     after.all(self.syslog_writer_after_all)
     after.each_feature(self.syslog_writer_after_each_feature)
     after.each_scenario(self.syslog_writer_after_each_scenario)
     after.each_step(self.syslog_writer_after_each_step)
Exemple #3
0
 def __init__(self):
     before.all(self.syslog_writer_before_all)
     before.each_feature(self.syslog_writer_before_each_feature)
     before.each_scenario(self.syslog_writer_before_each_scenario)
     before.each_step(self.syslog_writer_before_each_step)
     after.all(self.syslog_writer_after_all)
     after.each_feature(self.syslog_writer_after_each_feature)
     after.each_scenario(self.syslog_writer_after_each_scenario)
     after.each_step(self.syslog_writer_after_each_step)
Exemple #4
0
    def __init__(self):
        before.all(self.coverage_start)
        after.all(self.coverage_stop)

        if world.config.cover_packages:
            cover_packages = world.config.cover_packages.split(",")
        else:
            cover_packages = []
        self.coverage = Coverage(source=cover_packages)
Exemple #5
0
    def __init__(self):
        before.all(self.coverage_start)
        after.all(self.coverage_stop)

        if world.config.cover_packages:
            self.cover_packages = world.config.cover_packages.split(",")
        else:
            self.cover_packages = []

        self.coverage = None
        self.modules_on_init = set(sys.modules.keys())
Exemple #6
0
    def __init__(self):
        # import syslog only if the extension got loaded
        # but not if the module got loaded.
        import syslog

        before.all(self.syslog_writer_before_all)
        before.each_feature(self.syslog_writer_before_each_feature)
        before.each_scenario(self.syslog_writer_before_each_scenario)
        before.each_step(self.syslog_writer_before_each_step)
        after.all(self.syslog_writer_after_all)
        after.each_feature(self.syslog_writer_after_each_feature)
        after.each_scenario(self.syslog_writer_after_each_scenario)
        after.each_step(self.syslog_writer_after_each_step)
Exemple #7
0
    def __init__(self, marker):
        self.marker = marker
        # import syslog only if the extension got loaded
        # but not if the module got loaded.
        import syslog  # noqa

        before.all()(self.syslog_writer_before_all)
        before.each_feature()(self.syslog_writer_before_each_feature)
        before.each_scenario()(self.syslog_writer_before_each_scenario)
        before.each_step()(self.syslog_writer_before_each_step)
        after.all()(self.syslog_writer_after_all)
        after.each_feature()(self.syslog_writer_after_each_feature)
        after.each_scenario()(self.syslog_writer_after_each_scenario)
        after.each_step()(self.syslog_writer_after_each_step)
Exemple #8
0
    def __init__(self):
        try:
            from coverage import Coverage
        except ImportError:
            raise RadishError(
                'if you want to use the code coverage you have to "pip install radish-bdd[coverage]"'
            )

        before.all(self.coverage_start)
        after.all(self.coverage_stop)

        if world.config.cover_packages:
            self.cover_packages = world.config.cover_packages.split(",")
        else:
            self.cover_packages = []

        self.coverage = None
        self.modules_on_init = set(sys.modules.keys())