You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_progress.py 568 B

12345678910111213141516
  1. import pytest
  2. from fastNLP.envs.imports import _module_available
  3. from fastNLP.core.utils import f_tqdm_progress, f_rich_progress
  4. def test_raise():
  5. if not _module_available('tqdm') or f_rich_progress.dummy or f_tqdm_progress.dummy:
  6. pytest.skip('No tqdm')
  7. t = f_rich_progress.add_task('test', total=10)
  8. with pytest.raises(AssertionError):
  9. f_tqdm_progress.add_task('test')
  10. f_rich_progress.destroy_task(t)
  11. t = f_tqdm_progress.add_task('test', total=10)
  12. with pytest.raises(AssertionError):
  13. f_rich_progress.add_task('test')