Skip to content

Instantly share code, notes, and snippets.

View els-pnw's full-sized avatar

Eric Sammons els-pnw

View GitHub Profile
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):
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)
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:
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]
#!/usr/bin/env python
class Base(object):
def __init__(self):
pass
def is_true(self, s):
return s
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
@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())
''' 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)
''' 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)
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]))