Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix testing with tests.py on Py3.6. #8281

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

Merged
merged 1 commit into from
Mar 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/matplotlib/quiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@

'dots' or 'inches': pixels or inches, based on the figure dpi

'x', 'y', or 'xy': respectively *X*, *Y*, or :math:`\sqrt{X^2 + Y^2}`
'x', 'y', or 'xy': respectively *X*, *Y*, or :math:`\\sqrt{X^2 + Y^2}`
in data units

The arrows scale differently depending on the units. For
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/style/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# Users may want multiple library paths, so store a list of paths.
USER_LIBRARY_PATHS = [os.path.join(mpl._get_configdir(), 'stylelib')]
STYLE_EXTENSION = 'mplstyle'
STYLE_FILE_PATTERN = re.compile('([\S]+).%s$' % STYLE_EXTENSION)
STYLE_FILE_PATTERN = re.compile(r'([\S]+).%s$' % STYLE_EXTENSION)


# A list of rcParams that should not be applied from styles
Expand Down
6 changes: 0 additions & 6 deletions lib/matplotlib/tests/test_dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,6 @@ def test_too_many_date_ticks():
# setting equal datetimes triggers and expander call in
# transforms.nonsingular which results in too many ticks in the
# DayLocator. This should trigger a Locator.MAXTICKS RuntimeError
warnings.filterwarnings(
'ignore',
'Attempting to set identical left==right results\\nin singular '
'transformations; automatically expanding.\\nleft=\d*\.\d*, '
'right=\d*\.\d*',
UserWarning, module='matplotlib.axes')
t0 = datetime.datetime(2000, 1, 20)
Copy link
Member

Choose a reason for hiding this comment

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

Does this warning not come out of singular dates anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope (that's why the tests pass :-)).

tf = datetime.datetime(2000, 1, 20)
fig = plt.figure()
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/tests/test_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def find_matplotlib_font(**kw):
from matplotlib.font_manager import FontProperties, findfont
warnings.filterwarnings(
'ignore',
"findfont: Font family \[u?'Foo'\] not found. Falling back to .",
r"findfont: Font family \[u?'Foo'\] not found. Falling back to .",
UserWarning,
module='matplotlib.font_manager')

Expand Down
7 changes: 4 additions & 3 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@

if __name__ == '__main__':

import dateutil.parser
Copy link
Member

Choose a reason for hiding this comment

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

It's good to get rid of these in Matplotlib itself, but it's hacks like these that make me a bit wary to keep this test setup around. Maybe when we figure out the cron jobs, we can run this on a nightly build or something.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FWIW I think this test really belongs in something like pycodestyle.

try:
import setuptools
except ImportError:
pass

# The warnings need to be before any of matplotlib imports, but after
# setuptools (if present) which has syntax error with the warnings enabled.
# Filtering by module does not work as this will be raised by Python itself
# so `module=matplotlib.*` is out of questions.
# dateutil.parser and setuptools (if present) which has syntax error with
# the warnings enabled. Filtering by module does not work as this will be
# raised by Python itself so `module=matplotlib.*` is out of question.

import warnings

Expand Down