Skip to content
Snippets Groups Projects
Commit d31cdb0e authored by Georges Racinet's avatar Georges Racinet
Browse files

testhelpers: making environment more test-local

In may cases, `ui.environ` is simply `os.environ`, which
obviously causes side effect issues between tests.

One of these is that check_write was wrong: if no user
is provided, then permission should be granted.
parent f32d8597
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,7 @@
def test_write_empty_repo(tmpdir):
wrapper = init_repo(tmpdir)
switch_user(wrapper, 'guest')
with pytest.raises(error.HookAbort) as exc_info:
wrapper.write_commit('foo', content='Foo', return_ctx=True)
......
......@@ -31,6 +31,8 @@
ui = uimod.ui.load()
else:
ui = base_ui.copy()
if ui.environ is os.environ:
ui.environ = dict(ui.environ)
if config is not None:
for section_name, section in config.items():
for item_name, item_value in section.items():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment