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

Use 'pytest.fail' instead of 'assert' in test #871

Merged
merged 3 commits into from Jun 7, 2020

Conversation

stephenfin
Copy link
Contributor

If we use the latter, we see a really ugly, hard-to-parse traceback. The latter is much more subtle so use that.

The 'pytrace' variable is set to False on all values to avoid triggering a full traceback from 'pytest.fail' also [1].

If we use the latter, we see a really ugly, hard-to-parse traceback. The
latter is much more subtle so use that.

The 'pytrace' variable is set to False on all values to avoid triggering
a full traceback from 'pytest.fail' also [1].

[1] https://docs.pytest.org/en/stable/reference.html#pytest-fail

Signed-off-by: Stephen Finucane <stephen@that.guru>
Resolve a small bug in our reference PDF to generated PDF comparison,
whereby a missing reference PDF will generate the following failure:

  Mismatch between type of output (file) and reference (dir)

This will now return the following:

  No reference file at 'rst2pdf/tests/reference/foo' to compare against

Signed-off-by: Stephen Finucane <stephen@that.guru>
@stephenfin
Copy link
Contributor Author

We can improve this further by including the output log in the response too. I can do this in a follow up

Rather than having to cat this stuff yourself, show it on the screen.
Use a consistent function for this.

Signed-off-by: Stephen Finucane <stephen@that.guru>
@akrabat akrabat closed this in 88d6dc7 Jun 7, 2020
@akrabat akrabat merged commit 88d6dc7 into rst2pdf:master Jun 7, 2020
@akrabat
Copy link
Member

akrabat commented Jun 7, 2020

This is much nicer for the conftest errors. A followup that does magic to help with the compare errors would be loverly :)

@stephenfin stephenfin deleted the improved-pytest branch June 7, 2020 09:56
@akrabat akrabat added this to the 1.0 milestone Jun 20, 2020
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