question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

3.2.0: exceptions / internal errors related to markers

See original GitHub issue

I just tried the 3.2.0 pre-release with qutebrowser. First I get this during some tests:

__________________________________________________________ ERROR at setup of test_installed_package ___________________________________________________________

self = <_pytest.skipping.MarkEvaluator object at 0x7fbd0e725dd8>

    def istrue(self):
        try:
>           return self._istrue()

.tox/py36/lib/python3.6/site-packages/_pytest/skipping.py:99: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <_pytest.skipping.MarkEvaluator object at 0x7fbd0e725dd8>

    def _istrue(self):
        if hasattr(self, 'result'):
            return self.result
        if self.holder:
>           if self.holder.args or 'condition' in self.holder.kwargs:

.tox/py36/lib/python3.6/site-packages/_pytest/skipping.py:123: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <MarkInfo Mark(name='xfail', args=(), kwargs={'reason': 'https://github.com/qutebrowser/qutebrowser/issues/1070', 'strict': False})>

    def warned(self):
>       warnings.warn(warning, stacklevel=2)
E       _pytest.deprecated.RemovedInPytest4Warning: MarkInfo objects are deprecated as they contain the merged marks

.tox/py36/lib/python3.6/site-packages/_pytest/mark.py:15: RemovedInPytest4Warning

During handling of the above exception, another exception occurred:

self = <CallInfo when='setup' exception: 'MarkEvaluator' object has no attribute 'expr'>
func = <function call_runtest_hook.<locals>.<lambda> at 0x7fbd0e9609d8>, when = 'setup'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

.tox/py36/lib/python3.6/site-packages/_pytest/runner.py:157: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py36/lib/python3.6/site-packages/_pytest/runner.py:145: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py:254: in _wrapped_call
    return call_outcome.get_result()
.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py:279: in get_result
    raise ex[1].with_traceback(ex[2])
.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py:265: in __init__
    self.result = func()
.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py:254: in _wrapped_call
    return call_outcome.get_result()
.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py:279: in get_result
    raise ex[1].with_traceback(ex[2])
.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py:265: in __init__
    self.result = func()
.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py:254: in _wrapped_call
    return call_outcome.get_result()
.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py:279: in get_result
    raise ex[1].with_traceback(ex[2])
.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py:265: in __init__
    self.result = func()
.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py:614: in execute
    res = hook_impl.function(*args)
.tox/py36/lib/python3.6/site-packages/_pytest/skipping.py:189: in pytest_runtest_setup
    check_xfail_no_run(item)
.tox/py36/lib/python3.6/site-packages/_pytest/skipping.py:205: in check_xfail_no_run
    if evalxfail.istrue():
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <_pytest.skipping.MarkEvaluator object at 0x7fbd0e725dd8>

    def istrue(self):
        try:
            return self._istrue()
        except Exception:
            self.exc = sys.exc_info()
            if isinstance(self.exc[1], SyntaxError):
                msg = [" " * (self.exc[1].offset + 4) + "^", ]
                msg.append("SyntaxError: invalid syntax")
            else:
                msg = traceback.format_exception_only(*self.exc[:2])
            fail("Error evaluating %r expression\n"
                 "    %s\n"
                 "%s"
>                % (self.name, self.expr, "\n".join(msg)),
                 pytrace=False)
E           AttributeError: 'MarkEvaluator' object has no attribute 'expr'

.tox/py36/lib/python3.6/site-packages/_pytest/skipping.py:110: AttributeError

and then it fails entirely:

tests/end2end/features/test_history_bdd.py .....
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/main.py", line 108, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/main.py", line 144, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 745, in __call__
INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 339, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 334, in <lambda>
INTERNALERROR>     _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 614, in execute
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/main.py", line 167, in pytest_runtestloop
INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 745, in __call__
INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 339, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 334, in <lambda>
INTERNALERROR>     _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 613, in execute
INTERNALERROR>     return _wrapped_call(hook_impl.function(*args), self.execute)
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 254, in _wrapped_call
INTERNALERROR>     return call_outcome.get_result()
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 279, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 265, in __init__
INTERNALERROR>     self.result = func()
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 613, in execute
INTERNALERROR>     return _wrapped_call(hook_impl.function(*args), self.execute)
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 254, in _wrapped_call
INTERNALERROR>     return call_outcome.get_result()
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 279, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 265, in __init__
INTERNALERROR>     self.result = func()
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 613, in execute
INTERNALERROR>     return _wrapped_call(hook_impl.function(*args), self.execute)
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 254, in _wrapped_call
INTERNALERROR>     return call_outcome.get_result()
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 279, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 265, in __init__
INTERNALERROR>     self.result = func()
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 614, in execute
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/pytest_rerunfailures.py", line 52, in pytest_runtest_protocol
INTERNALERROR>     if "reruns" in rerun_marker.kwargs:
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/mark.py", line 15, in warned
INTERNALERROR>     warnings.warn(warning, stacklevel=2)
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/skipping.py", line 99, in istrue
INTERNALERROR>     return self._istrue()
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/skipping.py", line 123, in _istrue
INTERNALERROR>     if self.holder.args or 'condition' in self.holder.kwargs:
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/mark.py", line 15, in warned
INTERNALERROR>     warnings.warn(warning, stacklevel=2)
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/skipping.py", line 99, in istrue
INTERNALERROR>     return self._istrue()
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/skipping.py", line 123, in _istrue
INTERNALERROR>     if self.holder.args or 'condition' in self.holder.kwargs:
INTERNALERROR>   File "/home/florian/proj/qutebrowser/git/.tox/py36/lib/python3.6/site-packages/_pytest/mark.py", line 15, in warned
INTERNALERROR>     warnings.warn(warning, stacklevel=2)
INTERNALERROR> _pytest.deprecated.RemovedInPytest4Warning: MarkInfo objects are deprecated as they contain the merged marks

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
The-Compilercommented, Jul 14, 2017

As far as I know, I refactored all usages of parametrized marks to use pytest.param.

1reaction
The-Compilercommented, Jul 14, 2017

I can reproduce this with a simple xfailing test:

import pytest

@pytest.mark.xfail()
def test_foo():
    assert False

and launching pytest with --pythonwarnings error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exceptions - Rocket Software Documentation
Guidelines for Defining Related Entities in the Component Structure ... Browser Displays Page with HTTP 500 - Internal server error.
Read more >
"Updating Maven Project". java.lang.NullPointerException ...
When I try to add a dependency, this error message appears. I use Eclipse Kepler. An internal error occurred during: "Updating Maven Project"....
Read more >
Spring Boot, Maven and Eclipse Errors and TroubleShooting ...
Go for the complete list. If you are facing a exception or an error. Try searching with complete exception text; Try searching with...
Read more >
Detection of ArUco Markers - OpenCV
The marker size determines the size of the internal matrix. For instance a marker size ... Any specific id out of the valid...
Read more >
Changelog — pytest documentation
Note: This deprecation only relates to using unittest. ... issue #7707: Fix internal error when handling some exceptions that contain multiple lines or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found