This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bugzilla | |
import ConfigParser | |
class BugzillaHooks(object): | |
def __init__(self, config, bugzilla): | |
self.config = config | |
self.bugzilla = bugzilla | |
def pytest_runtest_makereport(self, __multicall__, item): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def pytest_runtest_makereport(self, __multicall__, item): | |
if isinstance(item, item.Function): | |
func = item.obj | |
bugzilla_marker = getattr(func, "bugzilla", None) | |
if bugzilla_marker is None: | |
return | |
report = __multicall__.execute() | |
report.bug_id = bugzilla_marker.args[0] | |
bug = self.bugzilla.getbugsimple(report.bug_id) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import pytest | |
import xmlrpclib | |
import bugzilla | |
class BugZillaInteg(object): | |
def get_bug_status(self, bugid): | |
"Returns the status of the bug with id bugid" | |
print "We are in get_bug_status" | |
try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import xmlrpclib | |
import bugzilla | |
class BugZillaInteg(object): | |
def get_bug_status(self, bugid): | |
"Returns the status of the bug with id bugid" | |
try: | |
bug = self.bugzilla.getbugsimple(bugid) | |
status = str(bug).split(None, 2)[1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
class Base(object): | |
def __init__(self): | |
pass | |
def is_true(self, s): | |
return s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
functionToCall = allowed['test1'] | |
> Assert.true(functionToCall) | |
tests/test_roles_datadriven.py:79: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <class unittestzero.Assert at 0x163a870> | |
first = <property object at 0x165fa48>, msg = None | |
@classmethod |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@property | |
def is_system_tab_visible(self): | |
""" | |
Returns True if the system tab is visible. | |
""" | |
return WebDriverWait(self.selenium, 20).until(lambda s: s.find_element(*tab_elements['systems_tab']).is_displayed()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' DO NOT EDIT HERE ''' | |
def pytest_generate_tests(metafunc): | |
idlist = [] | |
argvalues = [] | |
for scenario in metafunc.cls.scenarios: | |
idlist.append(scenario[0]) | |
items = scenario[1].items() | |
argnames = [x[0] for x in items] | |
argvalues.append(([x[1] for x in items])) | |
metafunc.parametrize(argnames, argvalues, ids=idlist) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' DO NOT EDIT HERE ''' | |
def pytest_generate_tests(metafunc): | |
idlist = [] | |
argvalues = [] | |
for scenario in metafunc.cls.scenarios: | |
idlist.append(scenario[0]) | |
items = scenario[1].items() | |
argnames = [x[0] for x in items] | |
argvalues.append(([x[1] for x in items])) | |
metafunc.parametrize(argnames, argvalues, ids=idlist) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
def pytest_generate_tests(metafunc): | |
idlist = [] | |
argvalues = [] | |
for scenario in metafunc.cls.scenarios: | |
idlist.append(scenario[0]) | |
items = scenario[1].items() | |
argnames = [x[0] for x in items] | |
argvalues.append(([x[1] for x in items])) |