-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bad delayed error on invalid keyword expression #3573
Comments
GitMate.io thinks possibly related issues are #1133 (InternalError: AttributeError: 'str' object has no attribute 'relto'), #1184 (Internal Error: AttributeError: 'str' object has no attribute 'relate'), #1365 (py.test occurred error in selenium "AttributeError: 'NoneType' object has no attribute 'fork_exec'"), #1805 (Fixture that calls getattr() on request.function throws an AttributeError: 'function' object has no attribute), and #1310 (AttributeError: '_HookCaller' object has no attribute 'spec_opts'). |
keword expressions don't suport nested object access there ought to be a better error, right now all we do is run the code and it has to break, because |
oh! My bad. should we keep this open for a better error message? |
yes, let me shift thins around |
the solution would be to either introduce a chainable keyword boolean so that
|
Previously, the expressions given to the `-m` and `-k` options were evaluated with `eval`. This causes a few issues: - Python keywords cannot be used. - Constants like numbers, None, True, False are not handled correctly. - Various syntax like numeric operators and `X if Y else Z` is supported unintentionally. - `eval()` is somewhat dangerous for arbitrary input. - Can fail in many ways so requires `except Exception`. The format we want to support is quite simple, so change to a custom parser. This fixes the issues above, and gives us full control of the format, so can be documented comprehensively and even be extended in the future if we wish. Fixes pytest-dev#1141. Fixes pytest-dev#3573. Fixes pytest-dev#5881. Fixes pytest-dev#6822. Fixes pytest-dev#7112.
Previously, the expressions given to the `-m` and `-k` options were evaluated with `eval`. This causes a few issues: - Python keywords cannot be used. - Constants like numbers, None, True, False are not handled correctly. - Various syntax like numeric operators and `X if Y else Z` is supported unintentionally. - `eval()` is somewhat dangerous for arbitrary input. - Can fail in many ways so requires `except Exception`. The format we want to support is quite simple, so change to a custom parser. This fixes the issues above, and gives us full control of the format, so can be documented comprehensively and even be extended in the future if we wish. Fixes pytest-dev#1141. Fixes pytest-dev#3573. Fixes pytest-dev#5881. Fixes pytest-dev#6822. Fixes pytest-dev#7112.
I have trouble to replicate this outside of Fedora build system, because bodhi has non-pip-installable dependencies.
However in Fedora build system with 3.7.0b5 installed and couple of dependencies:
I hit a problem when using
-k
:That's Python 3.7.0b5, pytest-3.6.1, py-1.5.3, pluggy-0.6.0.
Does this sound familiar? Google is not helpful.
The text was updated successfully, but these errors were encountered: