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

Support for ignoring tests when running valgrind #5150

Merged
merged 8 commits into from Jan 16, 2021

Conversation

wiredfool
Copy link
Member

Before we can add valgrind as an experimental docker test target, we need to have all of the tests passing or known ignored.

This adds:

  • a pytest configuration for ignoring the error when pytest-valgrind isn't installed.
  • Ignores the tiff_additional_metadata test, because we're sending some illogical values to it.

WIP -- there are more tests to investigate.

warnings.simplefilter("error")
try:
getattr(pytest.mark, "valgrind_known_error")
except:
Copy link
Member

Choose a reason for hiding this comment

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

?

Suggested change
except:
except AttributeError:

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think it's an attribute error, as it's catching a warning thrown by pytest which hooks the getattr to specifically avoid an attribute error.

Tests/test_file_libtiff.py Outdated Show resolved Hide resolved
# Ensure that the mark is defined even in cases where pytest-valgrind isn't installed

import pytest
import warnings
Copy link
Member

Choose a reason for hiding this comment

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

These could go at the top of the file.

Tests/conftest.py Outdated Show resolved Hide resolved
@radarhere radarhere force-pushed the valgrind_tests branch 2 times, most recently from 1dbfe2e to f546df4 Compare December 30, 2020 03:41
@wiredfool wiredfool marked this pull request as ready for review January 16, 2021 16:56
@wiredfool wiredfool merged commit e40a07b into python-pillow:master Jan 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants