Mercurial > hg
view tests/mockblackbox.py @ 43178:1b2200bd06b6
rust-cpython: add safe wrapper representing shared data borrowed from PyObject
PySharedRef is a tempoary wrapper around PySharedRefCell. It provides safe
functions for each shared data. $shared_accessor implements a safe method
to construct PySharedRefCell.
This allows us to add more than once PySharedRefCell to a Python object.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 15 Sep 2019 16:50:48 +0900 |
parents | 2372284d9457 |
children | 6000f5b25c9b |
line wrap: on
line source
from __future__ import absolute_import from mercurial.utils import procutil # XXX: we should probably offer a devel option to do this in blackbox directly def getuser(): return b'bob' def getpid(): return 5000 # mock the date and user apis so the output is always the same def uisetup(ui): procutil.getuser = getuser procutil.getpid = getpid