Mercurial > p > roundup > code
comparison test/test_admin.py @ 7802:7c0a8088b053
feat: add support for controlling readline history features
You can disable loading or saving the history file and disable loading
the readline rc file. This is controlled by pragma history_features
which is a bit string. Setting a bit disables the feature.
Also cleaned up a python traceback if an invalid pragma was specified
on the command line. Just displays an error message and drops into
interactive mode.
I had a hand when running regression tests with
tet-admin.py::testBasicInteractive. It was loading the history file
and saving the commands making the file huge. So disable all
history_features by default when testing by setting pragma to 7.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Wed, 13 Mar 2024 12:18:36 -0400 |
| parents | b2dbab2b34bc |
| children | 2746337ded4c |
comparison
equal
deleted
inserted
replaced
| 7801:af898d1d66dc | 7802:7c0a8088b053 |
|---|---|
| 132 | 132 |
| 133 AdminTool.my_input = lambda _self, _prompt: next(inputs) | 133 AdminTool.my_input = lambda _self, _prompt: next(inputs) |
| 134 | 134 |
| 135 self.install_init() | 135 self.install_init() |
| 136 self.admin=AdminTool() | 136 self.admin=AdminTool() |
| 137 sys.argv=['main', '-i', self.dirname] | 137 # set history_features to disable loading/saving history |
| 138 # and loading rc file. Otherwise file gets large and | |
| 139 # breaks testing or overwrites the users history file. | |
| 140 sys.argv=['main', '-i', self.dirname, '-P', 'history_features=7'] | |
| 138 | 141 |
| 139 with captured_output() as (out, err): | 142 with captured_output() as (out, err): |
| 140 ret = self.admin.main() | 143 ret = self.admin.main() |
| 141 | 144 |
| 142 out = out.getvalue().strip() | 145 out = out.getvalue().strip() |
