pytest: handle skipping without custom message

Specifying a "reason" argument for pytest.skip() is optional. In case there is a message specified (like usually), then it appears in the report after a colon. But in case this message isn't present, then there will be just a terse "skipped" message in the test report, without any colon, and the parser fails.

This change checks if there is a colon in the message first before trying to split it.

Here is an example project that does this in the wild: https://github.com/bigcat88/pillow_heif/blob/master/tests/import_error_test.py#L8

Merge request reports

Loading