Skip to content

Switch testing to pytest completely #7974

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 14 commits into from
Feb 3, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Move pytest_configure into installed area.
This allows it to work when run via matplotlib.test().
  • Loading branch information
QuLogic committed Feb 2, 2017
commit 25fdef89a4299843b3803666090bb2153989e506
19 changes: 0 additions & 19 deletions conftest.py

This file was deleted.

3 changes: 2 additions & 1 deletion lib/matplotlib/sphinxext/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import (absolute_import, division, print_function,
unicode_literals)

from matplotlib.tests.conftest import mpl_test_settings
from matplotlib.tests.conftest import (mpl_test_settings,
pytest_configure, pytest_unconfigure)
10 changes: 10 additions & 0 deletions lib/matplotlib/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@
import matplotlib


def pytest_configure(config):
matplotlib.use('agg')
matplotlib._called_from_pytest = True
matplotlib._init_tests()


def pytest_unconfigure(config):
matplotlib._called_from_pytest = False


@pytest.fixture(autouse=True)
def mpl_test_settings(request):
from matplotlib.testing.decorators import _do_cleanup
Expand Down
3 changes: 2 additions & 1 deletion lib/mpl_toolkits/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import (absolute_import, division, print_function,
unicode_literals)

from matplotlib.tests.conftest import mpl_test_settings
from matplotlib.tests.conftest import (mpl_test_settings,
pytest_configure, pytest_unconfigure)