@bdd.when('the documentation is up to date')
def update_documentation():
 base_path = os.path.dirname(os.path.abspath(qutebrowser.__file__))
 doc_path = os.path.join(base_path, 'html', 'doc')
 script_path = os.path.join(base_path, '..', 'scripts')
 if (not os.path.exists(doc_path)):
  return
 if all((docutils.docs_up_to_date(p) for p in os.listdir(doc_path))):
  return
 try:
  subprocess.call(['asciidoc'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
 except OSError:
  pytest.skip('Docs outdated and asciidoc unavailable!')
 update_script = os.path.join(script_path, 'asciidoc2html.py')
 subprocess.call([sys.executable, update_script])

@ bdd . when ( 'the documentation is up to date' ) def update_documentation ( ) : base_path = os . path . dirname ( os . path . abspath ( qutebrowser . __file__ ) ) doc_path = os . path . join ( base_path , 'html' , 'doc' ) script_path = os . path . join ( base_path , '..' , 'scripts' ) if ( not os . path . exists ( doc_path ) ) : return if all ( ( docutils . docs_up_to_date ( p ) for p in os . listdir ( doc_path ) ) ) : return try : subprocess . call ( [ 'asciidoc' ] , stdout = subprocess . DEVNULL , stderr = subprocess . DEVNULL ) except OSError : pytest . skip ( 'Docs outdated and asciidoc unavailable!' ) update_script = os . path . join ( script_path , 'asciidoc2html.py' ) subprocess . call ( [ sys . executable , update_script ] )
update the docs before testing :help .