Skip to content

Deal with fixture init failures in boost.test#31

Merged
nicoddemus merged 2 commits intopytest-dev:masterfrom
fj128:master
Mar 3, 2017
Merged

Deal with fixture init failures in boost.test#31
nicoddemus merged 2 commits intopytest-dev:masterfrom
fj128:master

Conversation

@fj128
Copy link
Copy Markdown
Contributor

@fj128 fj128 commented Mar 1, 2017

On sufficiently fatal errors (such as an exception thrown from a global fixture ctor) boost.test
ignores --output_format=XML and dumps the error message as is. I added an explicit check for those cases so the plugin no longer throws a weird exception from the depths of lxml due to malformed/empty xml.

(Alternatively I could check for result code 200 (aka boost::exit_exception_failure), but I'm not entirely sure that boost.test doesn't return it in some other cases, and I think that this approach is good enough)

fj128 and others added 2 commits March 1, 2017 15:16
On sufficiently fatal errors (such as an exception thrown from a global fixture ctor) boost.test
ignores --output_format=XML and dumps the error message as is. Check for those cases explicitly
instead of crashing due to malformed/empty xml.

(alternatively we could check for result code 200 (aka boost::exit_exception_failure), but I'm not
sure that boost.test doesn't return it in other cases)
@nicoddemus
Copy link
Copy Markdown
Member

Thanks a lot for the PR, appreciate it!

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling bc3316a on fj128:master into d1116a7 on pytest-dev:master.

@nicoddemus nicoddemus merged commit aad8926 into pytest-dev:master Mar 3, 2017
@nicoddemus
Copy link
Copy Markdown
Member

nicoddemus commented Mar 3, 2017

Just released 0.4.4 to PyPI and the conda forge package is under way: conda-forge/pytest-cpp-feedstock#7. Thanks again!

@fj128
Copy link
Copy Markdown
Contributor Author

fj128 commented Mar 6, 2017

Wait, it looks like you forgot to push 0.4.4 changes to github actually, there's no version bump nor tag.

By the way, how do you make the archives you publish on PyPI? It would be nice to have .tar.gz back, especially if the files inside weren't checked out with Windows line endings (not that it causes any real problems, but still)!

Also, it's entirely irrelevant, but while I'm at it: newer versions of boost.test offer a --list_content argument so theoretically now it's possible to have the boost adapter report actual test cases/suites like gtest does. Unfortunately that would be a regression performance- and correctness-wise, since each test will be run in a separate process, which will slow things down and break all tests that have implicit interdependencies and disable tests that use depends_on boost decorator. Fixing that would be pretty difficult I guess, since as far as I understand it would involve using a custom runner and conflict with xdist...

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.

3 participants