[pytest-dev] Improving pytest internal errors and messages

Oliver Bestwalter oliver at bestwalter.de
Thu Oct 4 17:35:59 EDT 2018


Glad to help Oliveira ;)

On Thu, 4 Oct 2018 at 21:28 Bruno Oliveira <nicoddemus at gmail.com> wrote:

> Hi Walter ;)
>
> On Thu, Oct 4, 2018 at 4:21 PM Oliver Bestwalter <oliver at bestwalter.de>
> wrote:
>
>> About the naming things problem: I don't know if this is overkill, but
>> how about having an exception like e.g. ReportableError or KnownError that
>> errors like using an invalid scope in your example can inherit from (e.g.
>> InvalidScope) can inherit from. All errors inheriting from that
>> ReportableError or KnownError could then be caught at the top level and be
>> reported differently without a noisy traceback (e.g. only printing out the
>> place where it occured and the error type and message).
>>
>
> I think ReportableError is a good name, as I'm having a hard time coming
> up with a good name that isn't similar to UsageError/UserError. :)
>
> Cheers,
> Bruno.
>
>
>>
>>
>> On Thu, 4 Oct 2018 at 15:51 Florian Bruhin <me at the-compiler.org> wrote:
>>
>>> Hey,
>>>
>>> On Thu, Oct 04, 2018 at 10:19:21AM -0300, Bruno Oliveira wrote:
>>> > This new exception type (I've used UsageError on my PR just for proof
>>> of
>>> > concept) should be part of the public API so plugins can also use it.
>>> >
>>> > I'm writing to the ML because it would be beneficial to get feedback
>>> from a
>>> > larger audience about what the *name* of the exception should be.
>>> >
>>> > UserError? InternalError?
>>>
>>> I dislike both, but without having a better idea (sorry :D). Here's why:
>>>
>>> UsageError is dangerously close to UsageError. It's also not clear
>>> from the name why they differ.
>>>
>>> InternalError sounds like the exceptions prefixed with INTERNALERROR>,
>>> (i.e. unhandled exceptions inside pytest), which seems like the exact
>>> opposite of what this is.
>>>
>>> Maybe we should rename UsageError to CliUsageError, or make sure
>>> UsageError is usable for this purpose?
>>>
>>> Florian
>>>
>>> --
>>> https://www.qutebrowser.org | me at the-compiler.org (Mail/XMPP)
>>>    GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc
>>>          I love long mails! | https://email.is-not-s.ms/
>>>
>> _______________________________________________
>>> pytest-dev mailing list
>>> pytest-dev at python.org
>>> https://mail.python.org/mailman/listinfo/pytest-dev
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20181004/b4a8ff03/attachment-0001.html>


More information about the pytest-dev mailing list