old_contents: # -*- coding: utf-8 -*-
  #
  import pygmsh
  import examples
  
  import os
  import tempfile
  from importlib import import_module
  import subprocess
  
  
  def test_generator():
      for name in examples.__all__:
          test = import_module('examples.' + name)
          yield check_output, test
  
  
  def check_output(test):
      pygmsh.generate_mesh(test.generate())
      return
  
  
  if __name__ == '__main__':
      test_io()
  
new_contents: # -*- coding: utf-8 -*-
  #
  import pygmsh
  import examples
  
  from importlib import import_module
  import pytest
  
  
  @pytest.mark.parametrize('name', examples.__all__)
  def test_check_output(name):
      test = import_module('examples.' + name)
      pygmsh.generate_mesh(test.generate())
      return
  
subject: use @pytest.mark.parametrize instead of yield