@pytest.fixture
def if_graphviz_found(app):
 graphviz_dot = getattr(app.config, 'graphviz_dot', '')
 try:
  if graphviz_dot:
   dot = subprocess.Popen([graphviz_dot, '-V'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
   dot.communicate()
   return
 except OSError:
  pass
 pytest.skip('graphviz "dot" is not available')

@ pytest . fixture def if_graphviz_found ( app ) : graphviz_dot = getattr ( app . config , 'graphviz_dot' , '' ) try : if graphviz_dot : dot = subprocess . Popen ( [ graphviz_dot , '-V' ] , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) dot . communicate ( ) return except OSError : pass pytest . skip ( 'graphviz "dot" is not available' )
the test will be skipped when using if_graphviz_found fixture and graphviz dot command is not found .