def delete_testing_branch():
repo = Repo('.')
gitobj = repo.git
# create 'test' branch if it doesn't exist so that it can be used for tests in this module
git_branch_string = gitobj.branch()
git_branch_list = git_branch_string.split("\n")
clean_branch_list = []
for branch in git_branch_list:
branch = branch.replace('*', '')
branch = branch.replace(' ', '')
clean_branch_list.append(branch)
if 'testing_branch' in clean_branch_list:
gitobj.branch('-d', 'testing_branch')
# ///////////////////////////////////////////////////////
#
# pytest capsys capture tests
# confirms capture of std output and std error streams
#
# ///////////////////////////////////////////////////////
评论列表
文章目录