[pytest-dev] [3.1 feature] "assert not raise exception" helper: opinions about the name

holger krekel holger at merlinux.eu
Thu Apr 6 02:30:31 EDT 2017


Hi Bruno,

On Thu, Apr 06, 2017 at 00:25 +0000, Bruno Oliveira wrote:
> Hi Walter!

heh, names are hard, let's go shopping? :)
 
> On Wed, Apr 5, 2017 at 7:00 PM Oliver Bestwalter <oliver at bestwalter.de>
> wrote:
> 
> > ... and this would be a bit harder to understand, because as Bruno found
> > out already, there are quite different expectations about what is supposed
> > to happen if I write pytest.raises(None).
> >
> > Am I missing something?
> >
> 
> Not really, that's the gist of it. :)

In case i wasn't clear -- i am fine to drop pytest.raises(None) in light
of your user tests.
 
> Myself I've experienced the need for this in pytest-qt's tests, which has
> lots of tests for a context manager which can raise an exception in various
> scenarios, but other than that I don't recall ever needing it actually.
> 
> After all the discussion I'm also inclining to just drop the feature since
> there doesn't seem to be consensus for a good API.

I am fine to have user-tests guide the decision ...  so now for me it's
only between offering a context manager or offering a special
"NoExceptionRaised" object which you can give to pytest.raises(...).  
so we are almost there and for me, the user-testing can decide that so it's
not much discussion left to do at least from my side ... 

So for me there is already one useful outcome of our discussion here:

- UI facing API is good to test against users/colleagues perceptions
  as it gives real-life empirical clues instead of gut feelings
  of implementors (including mine)

- maintenance costs or a raise in internal complexities
  also play into the evaluation of how/if to do something

cheers,
holger


 
> Cheers,
> Bruno.


More information about the pytest-dev mailing list