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

Pytest plugin: xdist-compatible stats collection breaks strict XML report validation #1935

Closed
danilomendesdias opened this issue Apr 18, 2019 · 2 comments
Labels
enhancement it's not broken, but we want it to be better meta for wider topics than the software itself

Comments

@danilomendesdias
Copy link

danilomendesdias commented Apr 18, 2019

As documented in https://docs.pytest.org/en/latest/usage.html#record-property, record_property (or its equivalent usage through custom markers, which I think that it is the approach chosen by hypothesis) is an experimental fixture that can break if <properties> inside <testcase> is not expected by XML schema verification.

My use case is to run in a CI server with jenkins + junit plugin (which I can't modify basically anything) and I'm not able to run newer versions of hypothesis due this. I know that having hypothesis information in reports is a nice feature, but as it can cause this kind of problems, my suggestion is to make it at least configurable by adding something like --turn-off-hypothesis-stats-on-reports.

Maybe this option is already available, but I couldn't find anything on docs. I can also contribute with a PR if you guys approve the idea and point me where to start.

Thanks in advance.

@danilomendesdias danilomendesdias changed the title Provide a way to disable hypothesis-stats on reports Provide a way to disable hypothesis-stats in reports Apr 18, 2019
@Zac-HD Zac-HD added the enhancement it's not broken, but we want it to be better label Apr 18, 2019
@Zac-HD
Copy link
Member

Zac-HD commented Apr 18, 2019

Hmm, we'll need to think about this - I added record_property because it's the only way I could find to pass stats between processes using pytest-xdist. I agree that it's not good to have this effect on XML reports, but that might be more of a Pytest issue than a Hypothesis issue...

Until we get the design sorted out, you can use pytest -p no:hypothesis to disable the plugin entirely.

@Zac-HD Zac-HD changed the title Provide a way to disable hypothesis-stats in reports Pytest plugin: xdist-compatible stats collection breaks strict XML report validation Apr 19, 2019
@Zac-HD Zac-HD added the meta for wider topics than the software itself label Apr 23, 2019
@Zac-HD
Copy link
Member

Zac-HD commented Apr 23, 2019

Closing this in favor of the upstream issue in Pytest. Thanks @danilomendesdias!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement it's not broken, but we want it to be better meta for wider topics than the software itself
Projects
None yet
Development

No branches or pull requests

2 participants