melissawm / sphinx-tags

A tiny Sphinx extension that implements blog-style tags for documentation.
https://sphinx-tags.readthedocs.io/en/latest/
MIT License
44 stars 11 forks source link

TST: migrate test output to minimal build #87

Open story645 opened 9 months ago

story645 commented 9 months ago

I think it'd be easier to test the behavior of directives and if there were sample built pages to look out. As a model, matplotlib and sphinx gallery both build minimal documents to test their directives:

TL;DR is that tinybuild is designed as a minimal full sphinx doc build that you can run with make html from the tinybuild/doc to get a traditional build experience, but also gets run in test_full.py so you can check for html or rst output. So basically you can think of stuff in test_full.py as pytests that have access to a full site built with sphinx-build.

One gotcha at the moment is that you might need to run make clean in tinybuild/doc for the pytest version to run properly

Originally posted by @larsoner in https://github.com/sphinx-gallery/sphinx-gallery/issues/1222#issuecomment-1793869622

This isn't too different from the current sample output but I think more robust.

JWCook commented 9 months ago

In what ways would this be more robust? Could you give an example?

story645 commented 9 months ago

In what ways would this be more robust?

1) generates all the output types, so you can easily test the html directly and that the other sphinx pages build 2) the ability to build the tinybuild docs independent of the tests makes it much easier to debug whether a test input is bad or the test is bad and why something is failing. Yes I can chase down the pytest cache directory but this is much easier.

JWCook commented 8 months ago

Okay, that makes sense. Thanks for the details! Sounds good to me.