new_contents: import matplotlib.pyplot as plt
  
  
  def pytest_configure(config):
      # Use matplotlib agg backend which does not require a display.
      plt.switch_backend('agg')
  
subject: Use headless matplotlib backend in tests (#2343)