1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
import os
import tempfile
HAS_PBCORE = False
try:
import pbcore
HAS_PBCORE = True
except ImportError:
HAS_PBCORE = False
def pbcore_skip_msg(msg=None):
msg = "" if msg is None else msg
return "" if HAS_PBCORE else "pbcore is not installed. {m}".format(m=msg)
def get_temp_file(suffix, dir_):
t = tempfile.NamedTemporaryFile(suffix=suffix, delete=False, dir=dir_)
t.close()
return t.name
def get_temp_dir(suffix=""):
"""This will make subdir in the root tmp dir"""
return tempfile.mkdtemp(dir=None, suffix=suffix)
def pb_requirements(*reqs):
"""
Method decorator for specifying linked JIRA issues.
"""
def decorator(test_item):
test_item.__pb_requirements__ = list(reqs)
return test_item
return decorator
|