Код: Выделить всё
if __name__ == "__main__":
import pytest
pytest.main(['--tb=short', __file__])
Код: Выделить всё
if __name__ == '__main__':
import pytest
pytest.main(['./test_stuff.py', "--capture=sys"])
Код: Выделить всё
============================== warnings summary ===============================
C:\Anaconda3\lib\site-packages\_pytest\config\__init__.py:754
C:\Anaconda3\lib\site-packages\_pytest\config\__init__.py:754: PytestWarning: Module already imported so cannot be rewritten: pytest_remotedata
self._mark_plugins_for_rewrite(hook)
C:\Anaconda3\lib\site-packages\_pytest\config\__init__.py:754: PytestWarning: Module already imported so cannot be rewritten: pytest_openfiles
self._mark_plugins_for_rewrite(hook)
C:\Anaconda3\lib\site-packages\_pytest\config\__init__.py:754: PytestWarning: Module already imported so cannot be rewritten: pytest_doctestplus
self._mark_plugins_for_rewrite(hook)
C:\Anaconda3\lib\site-packages\_pytest\config\__init__.py:754: PytestWarning: Module already imported so cannot be rewritten: pytest_arraydiff
self._mark_plugins_for_rewrite(hook)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
==================== 1 passed, 4 warnings in 0.06 seconds
Перезапуск ядра работает, но %reset IPython и %clear также недостаточно, чтобы это исправить.
Подробнее здесь: https://stackoverflow.com/questions/540 ... remotedata