Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Run unittest over a range of commits
import subprocess
import sys
def generate_commit(data_txt):
for line in data_txt.splitlines():
yield line.split()[0]
def main(git_path, start_commit, end_commit, python_path, unittest_file_path):
completed_process =[git_path, 'log', '--oneline', start_commit + '..' + end_commit], stdout=subprocess.PIPE)
for commit_txt in generate_commit(completed_process.stdout):
#[git_path, 'checkout', commit_txt.decode('utf-8')])[python_path, '-m', 'unittest', unittest_file_path])
if __name__ == '__main__':
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.