On Thu, Nov 9, 2017 at 10:53 AM, <[email protected]> wrote:

> I have unit tests where I expect failures in the certificate verification
> inside the C core, e.g.,:
>
> with self.assertRaises(...):
>     # do something that causes C core to log to stderr
>     pass
>
> # I'd like to check the specific error messages, e.g.:
> # assert 'some specific error message' in stderr
>
> Is it at all possible to inspect the stderr in order to check that
> specific error messages are logged?
>

I'm not aware of any way to do this from within the same process as the
system under test. It should be relatively easy to do if one's test
exercises the system under test in a subprocess.

I see `src/python/grpcio_tests/tests/_runner.py` does the stdout/stderr
> capture, so I'm trying to look there, but any guidance is appreciated!
> e.g., "it's possible: look here," or "it will require a major change and/or
> won't be accepted" :)
>

We'd likely consider it philosophically unpalatable - the specific text of
an error message should be prose addressed to a developer and not
considered part of the supported API of a system. We would not like it to
be the case that correcting a typo in a plain prose error message requires
an update to our tests.
-N

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CAEOYnASv76Yw6ZjniSVWEqWUkjNM_R5xBt8jpaE_sV%2BccYO-hA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to