-
Notifications
You must be signed in to change notification settings - Fork 356
Closed
Description
An exception is thrown in a RunPython function in a migration file
Without revealing too much it was an Index out of range exception

Expected Behaviour
That exception should be reported and it's traceback
Actual Behaviour
The following Error and traceback is reported
INTERNALERROR> File "****/lib/python3.6/site-packages/_pytest/main.py", line 191, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> File "****/lib/python3.6/site-packages/_pytest/main.py", line 235, in _main
INTERNALERROR> config.hook.pytest_runtestloop(session=session)
INTERNALERROR> File "****/lib/python3.6/site-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "****/lib/python3.6/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "****/lib/python3.6/site-packages/pluggy/manager.py", line 87, in <lambda>
INTERNALERROR> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR> File "****/lib/python3.6/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "****/lib/python3.6/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "****/lib/python3.6/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "****/lib/python3.6/site-packages/_pytest/main.py", line 256, in pytest_runtestloop
INTERNALERROR> item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR> File "****/lib/python3.6/site-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "****/lib/python3.6/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "****/lib/python3.6/site-packages/pluggy/manager.py", line 87, in <lambda>
INTERNALERROR> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR> File "****/lib/python3.6/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "****/lib/python3.6/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "****/lib/python3.6/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "****/lib/python3.6/site-packages/_pytest/runner.py", line 80, in pytest_runtest_protocol
INTERNALERROR> runtestprotocol(item, nextitem=nextitem)
INTERNALERROR> File "****/lib/python3.6/site-packages/_pytest/runner.py", line 89, in runtestprotocol
INTERNALERROR> rep = call_and_report(item, "setup", log)
INTERNALERROR> File "****/lib/python3.6/site-packages/_pytest/runner.py", line 178, in call_and_report
INTERNALERROR> report = hook.pytest_runtest_makereport(item=item, call=call)
INTERNALERROR> File "****/lib/python3.6/site-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "****/lib/python3.6/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "****/lib/python3.6/site-packages/pluggy/manager.py", line 87, in <lambda>
INTERNALERROR> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR> File "****/lib/python3.6/site-packages/pluggy/callers.py", line 203, in _multicall
INTERNALERROR> gen.send(outcome)
INTERNALERROR> File "****/lib/python3.6/site-packages/_pytest/skipping.py", line 123, in pytest_runtest_makereport
INTERNALERROR> rep = outcome.get_result()
INTERNALERROR> File "****/lib/python3.6/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "****/lib/python3.6/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "****/lib/python3.6/site-packages/_pytest/runner.py", line 252, in pytest_runtest_makereport
INTERNALERROR> return TestReport.from_item_and_call(item, call)
INTERNALERROR> File "****/lib/python3.6/site-packages/_pytest/reports.py", line 282, in from_item_and_call
INTERNALERROR> excinfo, style=item.config.getoption("tbstyle", "auto")
INTERNALERROR> File "****/lib/python3.6/site-packages/_pytest/nodes.py", line 299, in _repr_failure_py
INTERNALERROR> truncate_locals=truncate_locals,
INTERNALERROR> File "****/lib/python3.6/site-packages/_pytest/_code/code.py", line 597, in getrepr
INTERNALERROR> return fmt.repr_excinfo(self)
INTERNALERROR> File "****/lib/python3.6/site-packages/_pytest/_code/code.py", line 829, in repr_excinfo
INTERNALERROR> reprtraceback = self.repr_traceback(excinfo)
INTERNALERROR> File "****/lib/python3.6/site-packages/_pytest/_code/code.py", line 777, in repr_traceback
INTERNALERROR> reprentry = self.repr_traceback_entry(entry, einfo)
INTERNALERROR> File "****/lib/python3.6/site-packages/_pytest/_code/code.py", line 736, in repr_traceback_entry
INTERNALERROR> reprargs = self.repr_args(entry) if not short else None
INTERNALERROR> File "****/lib/python3.6/site-packages/_pytest/_code/code.py", line 655, in repr_args
INTERNALERROR> args.append((argname, saferepr(argvalue)))
INTERNALERROR> File "****/lib/python3.6/site-packages/_pytest/_io/saferepr.py", line 67, in saferepr
INTERNALERROR> return SafeRepr(maxsize).repr(obj)
INTERNALERROR> File "****/lib/python3.6/site-packages/_pytest/_io/saferepr.py", line 36, in repr
INTERNALERROR> s = super().repr(x)
INTERNALERROR> File "****/lib/python3.6/reprlib.py", line 55, in repr
INTERNALERROR> return self.repr1(x, self.maxlevel)
INTERNALERROR> File "****/lib/python3.6/reprlib.py", line 65, in repr1
INTERNALERROR> return self.repr_instance(x, level)
INTERNALERROR> File "****/lib/python3.6/site-packages/_pytest/_io/saferepr.py", line 43, in repr_instance
INTERNALERROR> s = repr(x)
INTERNALERROR> File "****/lib/python3.6/site-packages/django/db/models/query.py", line 250, in __repr__
INTERNALERROR> data = list(self[:REPR_OUTPUT_SIZE + 1])
INTERNALERROR> File "****/lib/python3.6/site-packages/django/db/models/query.py", line 274, in __iter__
INTERNALERROR> self._fetch_all()
INTERNALERROR> File "****/lib/python3.6/site-packages/django/db/models/query.py", line 1242, in _fetch_all
INTERNALERROR> self._result_cache = list(self._iterable_class(self))
INTERNALERROR> File "****/lib/python3.6/site-packages/django/db/models/query.py", line 55, in __iter__
INTERNALERROR> results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
INTERNALERROR> File "****/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1098, in execute_sql
INTERNALERROR> cursor = self.connection.cursor()
INTERNALERROR> File "****/lib/python3.6/site-packages/django/db/backends/base/base.py", line 256, in cursor
INTERNALERROR> return self._cursor()
INTERNALERROR> File "****/lib/python3.6/site-packages/django/db/backends/base/base.py", line 233, in _cursor
INTERNALERROR> self.ensure_connection()
INTERNALERROR> File "****/lib/python3.6/site-packages/pytest_django/plugin.py", line 772, in _blocking_wrapper
INTERNALERROR> "Database access not allowed, "
INTERNALERROR> File "****/lib/python3.6/site-packages/_pytest/outcomes.py", line 128, in fail
INTERNALERROR> raise Failed(msg=msg, pytrace=pytrace)
INTERNALERROR> Failed: Database access not allowed, use the "django_db" mark, or the "db" or "transactional_db" fixtures to enable it.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels