-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
good first issueeasy issue that is friendly to new contributoreasy issue that is friendly to new contributortopic: reportingrelated to terminal output and user-facing messages and errorsrelated to terminal output and user-facing messages and errors
Description
-
a detailed description of the bug or suggestion
I would likepytest.raises
to check if strings have parenthesis in them when match is not None, so that people have that lightbulb moment, rather than head-scratching when it presents two identical strings as not matching.E AssertionError: Pattern 'Length of values (29) does not match length of index (30)' does not match 'Length of values (29) does not match length of index (30)'
-
output of
pip list
from the virtual environment you are using
I believe this is not applicable right now. I'm happy to provide one if you believe other modules or libraries are causing this behavior. -
pytest and operating system versions
Windows 10 64-bit (I know), all updates installed
Pytest 5.4.3 -
minimal example if possible edited 22:31 (same day) as the example given was the fixed code including escapes and r prefix
msg = ( f"Length of values ({len(newcolumndata)}) " f"does not match length of index ({len(data)})" ) with pytest.raises(MismatchedIndexValueError, match=msg):
I believe a more helpful error message
=============================================================================== warnings summary ===============================================================================
tests/whatever/file.py::test_whatever_function_name_is
file.py:42: UserWarning: non regex passed to match
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================================================================== short test summary info ============================================================================
E AssertionError: Pattern 'Length of values (29) does not match length of index (30)' does not match 'Length of values (29) does not match length of index (30)'
Metadata
Metadata
Assignees
Labels
good first issueeasy issue that is friendly to new contributoreasy issue that is friendly to new contributortopic: reportingrelated to terminal output and user-facing messages and errorsrelated to terminal output and user-facing messages and errors