def test(): emojize = bootstrap() clean_up('test-output') os.mkdir('test-output') # exit_code = execute_command('pipenv lock') # success = not exit_code # if success: # LOGGER.info('Successfully created lock file %s', # emojize(':white_heavy_check_mark:'), # emojize(':thumbs_up:')) # else: # LOGGER.error('%s Errors creating lock file! %s', # emojize(':cross_mark:'), # emojize(':crying_face:')) # raise SystemExit(1) save_requirements() exit_code = execute_command('tox') success = not exit_code if success: open_file(os.path.join('test-output', 'coverage', 'index.html')) sleep(0.5) open_file(os.path.join('test-output', 'nosetests.html')) LOGGER.info('%s No testing errors found! %s', emojize(':white_heavy_check_mark:'), emojize(':thumbs_up:')) else: LOGGER.error('%s Testing errors found! %s', emojize(':cross_mark:'), emojize(':crying_face:')) raise SystemExit(exit_code)
def document(): emojize = bootstrap() clean_up( ('_build', os.path.join('docs', '_build'), os.path.join('docs', 'test_docs.rst'), os.path.join('docs', 'modules.rst'))) exit_code = execute_command('make -C docs html') success = not exit_code if success: shutil.move(os.path.join('docs', '_build'), '_build') path = os.path.join('_build', 'html', 'index.html') open_file(path) LOGGER.info('%s Successfully built documentation %s', emojize(':white_heavy_check_mark:'), emojize(':thumbs_up:')) else: LOGGER.error('%s Documentation creation errors found! %s', emojize(':cross_mark:'), emojize(':crying_face:')) raise SystemExit(exit_code)
def test(): bootstrap() clean_up('test-output') os.mkdir('test-output') save_requirements() success = execute_command('tox') try: open_file(os.path.join('test-output', 'coverage', 'index.html')) sleep(0.5) open_file(os.path.join('test-output', 'nosetests.html')) except Exception: LOGGER.warning('Could not execute UI portion. Maybe running headless?') if success: LOGGER.info('%s No testing errors found! %s', emojize(':white_heavy_check_mark:'), emojize(':thumbs_up:')) else: LOGGER.error('%s Testing errors found! %s', emojize(':cross_mark:'), emojize(':crying_face:')) raise SystemExit(0 if success else 1)
def document(): emojize = bootstrap() clean_up(('_build', os.path.join('docs', '_build'), os.path.join('docs', 'test_docs.rst'), os.path.join('docs', 'modules.rst'))) success = execute_command('make -C docs html') if success: shutil.move(os.path.join('docs', '_build'), '_build') try: open_file(os.path.join('_build', 'html', 'index.html')) except Exception: LOGGER.warning('Could not execute UI portion. Maybe running headless?') LOGGER.info('%s Successfully built documentation %s', emojize(':white_heavy_check_mark:'), emojize(':thumbs_up:')) else: LOGGER.error('%s Documentation creation errors found! %s', emojize(':cross_mark:'), emojize(':crying_face:')) raise SystemExit(0 if success else 1)