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

Embed: add more tests #7962

Merged
merged 7 commits into from Mar 2, 2021
Merged

Embed: add more tests #7962

merged 7 commits into from Mar 2, 2021

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Feb 25, 2021

Now is more easy to add more.

  • Change to pytest tests to be able to use parametrize
  • Actually test the returned html

Based on #7955

stsewd and others added 6 commits February 23, 2021 19:01
- Make them more readable by splitting the html from the json file,
  similarly to what we do with the search tests.
- Don't do two calls to storage, just open the file.
- Remove unused requests adaptor (probably was something used before
  storage)

Didn't bother to split the mkdocs json file,
since that mkdocs doesn't output that kind of format anymore,
we should start reading from the html file itself.
Co-authored-by: Manuel Kaufmann <humitos@gmail.com>
- Use version.is_sphinx_type to choose between mkdocs or sphinx
- Avoid nested code
- Check for multiple queries inside a loop instead of several if's
- Clean links only to the end result node, not to the whole body
Now is more easy to add more.
@stsewd stsewd requested a review from a team February 25, 2021 23:04
Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a good refactor.

self.version = self.project.versions.get(slug=LATEST)

settings.USE_SUBDOMAIN = True
settings.PUBLIC_DOMAIN = 'readthedocs.io'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to do this here instead of @override_settings?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

override_settings doesn't work with pytest's style tests. pytest provides the settings fixture instead

Base automatically changed from refactor-embed-view to master March 2, 2021 23:41
@stsewd stsewd merged commit 5bbe181 into master Mar 2, 2021
0 of 3 checks passed
@stsewd stsewd deleted the improve-embed-tests branch March 2, 2021 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants