Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Sphinx integration testing #15

Closed
choldgraf opened this issue Feb 21, 2020 · 5 comments · Fixed by #107
Closed

Add Sphinx integration testing #15

choldgraf opened this issue Feb 21, 2020 · 5 comments · Fixed by #107
Labels
testing Additional testing to add

Comments

@choldgraf
Copy link
Member

Since this is a Sphinx parser, we should add some tests that use Sphinx infrastructure to make sure it behaves as expected. As a start, something like:

  • A notebook that has all of the syntax we'd expect to see from users
  • A test suite that builds a site from this notebook, and checks the outputs to make sure they behave as expected (or maybe tests the AST?)

Ideally, we could set this up so that, as functionality grows, we can naturally extend the test suite. So I'd like to not do anything too bespoke and hacky.

@chrisjsewell or @mmcky or @akhmerov do you have any suggestions or template code you can contribute to start us off with a good way to test Sphinx projects?

@chrisjsewell
Copy link
Member

Yeh, look at the test_sphinx folder (and top-level conftest.py) in the myst_parser. It does exactly this, using Sphinx’s pytest fixtures 😁

@chrisjsewell
Copy link
Member

chrisjsewell commented Feb 21, 2020

It also uses beautifulsoup and pytest-regressions to extract the body of HTML pages and test them against the expected outcome (some things in the footer/header can change dependent on installed package versions etc)

@choldgraf
Copy link
Member Author

you are much more disciplined about writing tests than I am...

@chrisjsewell
Copy link
Member

It’s all about that Test Driven Development life 😂

@choldgraf choldgraf changed the title Add tests (also, what's a good way to do testing with Sphinx?) Add tests Feb 21, 2020
@chrisjsewell chrisjsewell changed the title Add tests Add Sphinx integration testing Mar 14, 2020
@chrisjsewell
Copy link
Member

Most 'lower-level' testing has now been added. But we should add a full sphinx integration test (like in myst-parser)

@chrisjsewell chrisjsewell added the testing Additional testing to add label Mar 14, 2020
@chrisjsewell chrisjsewell linked a pull request Apr 1, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Additional testing to add
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants