<s> """<STR_LIT>""" <EOL> import optparse <EOL> import os <EOL> import shutil <EOL> import time <EOL> from seleniumbase . config import settings <EOL> from seleniumbase . fixtures import constants <EOL> def pytest_addoption ( parser ) : <EOL> parser . addoption ( '<STR_LIT>' , action = "<STR_LIT:store>" , <EOL> dest = '<STR_LIT>' , <EOL> choices = constants . Browser . VERSION . keys ( ) , <EOL> default = constants . Browser . FIREFOX , <EOL> help = """<STR_LIT>""" ) <EOL> parser . addoption ( '<STR_LIT>' , action = "<STR_LIT:store_true>" , <EOL> dest = '<STR_LIT>' , <EOL> default = True , <EOL> help = """<STR_LIT>""" ) <EOL> parser . addoption ( '<STR_LIT>' , dest = '<STR_LIT:data>' , <EOL> default = None , <EOL> help = '<STR_LIT>' ) <EOL> parser . addoption ( '<STR_LIT>' , action = "<STR_LIT:store_true>" , <EOL> dest = '<STR_LIT>' , <EOL> default = False , <EOL> help = "<STR_LIT>" ) <EOL> parser . addoption ( '<STR_LIT>' , action = "<STR_LIT:store_true>" , <EOL> dest = '<STR_LIT>' , <EOL> default = False , <EOL> help = "<STR_LIT>" ) <EOL> parser . addoption ( '<STR_LIT>' , dest = '<STR_LIT>' , <EOL> default = '<STR_LIT>' , <EOL> help = '<STR_LIT>' ) <EOL> parser . addoption ( '<STR_LIT>' , action = "<STR_LIT:store_true>" , <EOL> dest = '<STR_LIT>' , <EOL> default = False , <EOL> help = "<STR_LIT>" ) <EOL> parser . addoption ( '<STR_LIT>' , action = '<STR_LIT:store>' , <EOL> dest = '<STR_LIT>' , <EOL> choices = ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:test>' ) , <EOL> default = '<STR_LIT:test>' , <EOL> help = optparse . SUPPRESS_HELP ) <EOL> parser . addoption ( '<STR_LIT>' , action = "<STR_LIT:store_true>" , <EOL> dest = '<STR_LIT>' , <EOL> default = False , <EOL> help = "<STR_LIT>" ) <EOL> parser . addoption ( '<STR_LIT>' , action = "<STR_LIT:store_true>" , <EOL> dest = '<STR_LIT>' , <EOL> default = False , <EOL> help = "<STR_LIT>" ) <EOL> parser . addoption ( '<STR_LIT>' , action = "<STR_LIT:store_true>" , <EOL> dest = '<STR_LIT>' , <EOL> default = False , <EOL> help = "<STR_LIT>" ) <EOL> parser . addoption ( '<STR_LIT>' , action = "<STR_LIT:store_true>" , <EOL> dest = '<STR_LIT>' , <EOL> default = False , <EOL> help = "<STR_LIT>" ) <EOL> parser . addoption ( '<STR_LIT>' , action = "<STR_LIT:store_true>" , <EOL> dest = '<STR_LIT>' , <EOL> default = False , <EOL> help = """<STR_LIT>""" ) <EOL> parser . addoption ( '<STR_LIT>' , action = "<STR_LIT:store_true>" , <EOL> dest = '<STR_LIT>' , <EOL> default = False , <EOL> help = """<STR_LIT>""" ) <EOL> parser . addoption ( '<STR_LIT>' , action = '<STR_LIT:store>' , dest = '<STR_LIT>' , <EOL> default = None , <EOL> help = """<STR_LIT>""" ) <EOL> def pytest_configure ( config ) : <EOL> """<STR_LIT>""" <EOL> log_folder_setup ( config ) <EOL> def log_folder_setup ( config ) : <EOL> """<STR_LIT>""" <EOL> with_testing_base = config . getoption ( '<STR_LIT>' ) <EOL> if with_testing_base : <EOL> log_path = config . getoption ( '<STR_LIT>' ) <EOL> if log_path . endswith ( "<STR_LIT:/>" ) : <EOL> log_path = log_path [ : - <NUM_LIT:1> ] <EOL> if not os . path . exists ( log_path ) : <EOL> os . makedirs ( log_path ) <EOL> else : <EOL> archived_folder = "<STR_LIT>" % log_path <EOL> if not os . path . exists ( archived_folder ) : <EOL> os . makedirs ( archived_folder ) <EOL> archived_logs = "<STR_LIT>" % ( archived_folder , int ( time . time ( ) ) ) <EOL> shutil . move ( log_path , archived_logs ) <EOL> os . makedirs ( log_path ) <EOL> if not settings . ARCHIVE_EXISTING_LOGS : <EOL> shutil . rmtree ( archived_logs ) <EOL> def pytest_unconfigure ( ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def pytest_runtest_setup ( ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def pytest_runtest_teardown ( ) : <EOL> """<STR_LIT>""" <EOL> pass </s>
