tests: mock getpid to reduce glob usage
With util.getpid, it is now possible to define fixed pids.
Future iterations can define a map of pids on a locked
first come first serve basis to create a more realistic
harness, but for now this is good enough.
This applies to blackbox, but could apply to other
tests as well.
from mercurial import util
def makedate():
return 0, 0
def getuser():
return 'bob'
def getpid():
return 5000
# mock the date and user apis so the output is always the same
def uisetup(ui):
util.makedate = makedate
util.getuser = getuser
util.getpid = getpid