[hawkmoth] Re: [PATCH 3/4] test: transition directive tests to dynamically generated test methods

  • From: Bruno Santos <brunomanuelsantos@xxxxxxxxxxxxxxxxxx>
  • To: Jani Nikula <jani@xxxxxxxxxx>
  • Date: Tue, 29 Jan 2019 00:31:18 +0100

On 00:20:14 2019-01-29, Jani Nikula wrote:

On Sun, 27 Jan 2019, Bruno Santos <brunomanuelsantos@xxxxxxxxxxxxxxxxxx> 
wrote:
I think you misunderstood me. I mean Sphinx's actual stdout (it doesn't
use stderr as it should), not the text/html output. This would be used
to look for build warnings and errors, which shouldn't be that hard.

Silly me, yes, we should do this. Sorry for the confusion.

I think the current output comparison is fine. Also, I still don't
understand in which cases the html comparison would be desirable. I'm
actually arguing we shouldn't care about it regardless of the
implementation being easy or not.

Two goals:

1. Ensure the directive actually does something.

Plain text definitely suffices for this one :)


2. Ensure what the directive feeds to Sphinx internals produces the same
output as Sphinx reading the rst from file.

If the expected rst contains a cross-reference, but the actual rst from
parser to Sphinx contains plain text, the Sphinx text builder loses the
distinction between the two. Both become plain text. The html build
preserves the distinction.

Ah, I see. The same issue arises with bolds and italics, etc. That's all
lost in plain text, but I don't think that's the point of these tests. I
would still prefer some discretion in writing the test cases to preserve
the speed and nicer diffs.

Anyway, I'll stand down. You can push the patch switching to html
builds.

Cheers,
Bruno


Of course, having the parser test should cover this case, and it's
unlikely the actual output fed to Sphinx internals would be different
from what is passed to the parser test.

BR,
Jani.

Other related posts: