Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[test] Test the multi-delete in journaled_data
Test following situation: ("set", dict(path=["a"], value={"c": [1, 2, 3]})), ("set", dict(path=["a", "b"], value=2)), ("set", dict(path=["a", "c"], value=[1])) Previously stack: E core.exceptions.Error: E ------------------------------- Patch Error ---------------------------------- E Path: E [] E Patchset: E [['a'], {'b': 0, 'c': [1, 2], 'd': {'da': ''}}] E [['a', 'b'], 1] E [['a', 'c', 2], 3] E [['a', 'e'], {'ea': 1, 'eb': 2}] E [['a', 'd']] E [['a', 'b'], 2] E [['a', 'd'], ['f']] E [['a', 'd'], 1] E [['a', 'd'], 2] E [['a', 'd'], 3] E [['a', 'b']] E [['a', 'new'], 1] E [['a', 'e', 'ec'], 'EC'] E [['a', 'e', 'ed'], 'ED'] E [['a', 'c', 1]] E => [['a', 'c', 2]] E [['a', 'c', 1], 2] E [['a', 'c', 2], 3] E E Current data: E { E "a": { E "c": [ E 1, E 3 E ], E "e": { E "ea": 1, E "eb": 2, E "ec": "EC", E "ed": "ED" E }, E "d": 3, E "new": 1 E } E } E E Traceback: E sys.exit(pytest.main(args, plugins_to_load + [Plugin])) E File ".../python3.7/site-packages/_pytest/config/__init__.py", line 165, in main E config=config E File ".../python3.7/site-packages/pluggy/hooks.py", line 286, in __call__ E return self._hookexec(self, self.get_hookimpls(), kwargs) E File ".../python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec E return self._inner_hookexec(hook, methods, kwargs) E File ".../python3.7/site-packages/pluggy/manager.py", line 87, in <lambda> E firstresult=hook.spec.opts.get("firstresult") if hook.spec else False, E File ".../python3.7/site-packages/pluggy/callers.py", line 187, in _multicall E res = hook_impl.function(*args) E File ".../python3.7/site-packages/_pytest/main.py", line 306, in pytest_cmdline_main E return wrap_session(config, _main) E File ".../python3.7/site-packages/_pytest/main.py", line 257, in wrap_session E session.exitstatus = doit(config, session) or 0 E File ".../python3.7/site-packages/_pytest/main.py", line 313, in _main E config.hook.pytest_runtestloop(session=session) E File ".../python3.7/site-packages/pluggy/hooks.py", line 286, in __call__ E return self._hookexec(self, self.get_hookimpls(), kwargs) E File ".../python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec E return self._inner_hookexec(hook, methods, kwargs) E File ".../python3.7/site-packages/pluggy/manager.py", line 87, in <lambda> E firstresult=hook.spec.opts.get("firstresult") if hook.spec else False, E File ".../python3.7/site-packages/pluggy/callers.py", line 187, in _multicall E res = hook_impl.function(*args) E File ".../python3.7/site-packages/_pytest/main.py", line 338, in pytest_runtestloop E item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) E File ".../python3.7/site-packages/pluggy/hooks.py", line 286, in __call__ E return self._hookexec(self, self.get_hookimpls(), kwargs) E File ".../python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec E return self._inner_hookexec(hook, methods, kwargs) E File ".../python3.7/site-packages/pluggy/manager.py", line 87, in <lambda> E firstresult=hook.spec.opts.get("firstresult") if hook.spec else False, E File ".../python3.7/site-packages/pluggy/callers.py", line 187, in _multicall E res = hook_impl.function(*args) E File ".../python3.7/site-packages/_pytest/runner.py", line 110, in pytest_runtest_protocol E runtestprotocol(item, nextitem=nextitem) E File ".../python3.7/site-packages/_pytest/runner.py", line 127, in runtestprotocol E reports.append(call_and_report(item, "call", log)) E File ".../python3.7/site-packages/_pytest/runner.py", line 216, in call_and_report E call = call_runtest_hook(item, when, **kwds) E File ".../python3.7/site-packages/_pytest/runner.py", line 256, in call_runtest_hook E lambda: ihook(item=item, **kwds), when=when, reraise=reraise E File ".../python3.7/site-packages/_pytest/runner.py", line 310, in from_call E result = func() # type: Optional[TResult] E File ".../python3.7/site-packages/_pytest/runner.py", line 256, in <lambda> E lambda: ihook(item=item, **kwds), when=when, reraise=reraise E File ".../python3.7/site-packages/pluggy/hooks.py", line 286, in __call__ E return self._hookexec(self, self.get_hookimpls(), kwargs) E File ".../python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec E return self._inner_hookexec(hook, methods, kwargs) E File ".../python3.7/site-packages/pluggy/manager.py", line 87, in <lambda> E firstresult=hook.spec.opts.get("firstresult") if hook.spec else False, E File ".../python3.7/site-packages/pluggy/callers.py", line 187, in _multicall E res = hook_impl.function(*args) E File ".../python3.7/site-packages/_pytest/runner.py", line 163, in pytest_runtest_call E item.runtest() E File ".../python3.7/site-packages/_pytest/python.py", line 1627, in runtest E self.ihook.pytest_pyfunc_call(pyfuncitem=self) E File ".../python3.7/site-packages/pluggy/hooks.py", line 286, in __call__ E return self._hookexec(self, self.get_hookimpls(), kwargs) E File ".../python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec E return self._inner_hookexec(hook, methods, kwargs) E File ".../python3.7/site-packages/pluggy/manager.py", line 87, in <lambda> E firstresult=hook.spec.opts.get("firstresult") if hook.spec else False, E File ".../python3.7/site-packages/pluggy/callers.py", line 187, in _multicall E res = hook_impl.function(*args) E File ".../python3.7/site-packages/_pytest/python.py", line 184, in pytest_pyfunc_call E result = testfunction(**testargs) E File ".../tests/utilities/test_journaled_data.py", line 205, in test_with_full_journaling_can_apply_journal E rdata.patch(patchset=data.dump_changes()) E File ".../utilities/journaled_data.py", line 222, in patch E self._patch_lk(path=path, patchset=patchset) E E Exception Traceback (most recent call last): E File ".../utilities/journaled_data.py", line 235, in patch_fragment E _path, _value = patch E ValueError: not enough values to unpack (expected 2, got 1) E E During handling of the above exception, another exception occurred: E E Traceback (most recent call last): E File ".../utilities/journaled_data.py", line 243, in _patch E patch_fragment(patch) E File ".../utilities/journaled_data.py", line 239, in patch_fragment E self._unset(path + _path) E File ".../utilities/journaled_data.py", line 286, in _unset E del data[path[-1]] E IndexError: list assignment index out of range E ------------------------------------------------------------------------------
- Loading branch information