def pytest_configure(config): sys._called_from_test = True if os.environ.get('TRAVIS'): import matplotlib matplotlib.use('Agg')