test_app.py 1003 B

12345678910111213141516171819202122232425262728293031
  1. """Test QtConsoleApp"""
  2. # Copyright (c) Jupyter Development Team.
  3. # Distributed under the terms of the Modified BSD License.
  4. import os
  5. import sys
  6. from subprocess import check_output
  7. from jupyter_core import paths
  8. import pytest
  9. from traitlets.tests.utils import check_help_all_output
  10. from . import no_display
  11. @pytest.mark.skipif(no_display, reason="Doesn't work without a display")
  12. def test_help_output():
  13. """jupyter qtconsole --help-all works"""
  14. check_help_all_output('qtconsole')
  15. @pytest.mark.skipif(no_display, reason="Doesn't work without a display")
  16. @pytest.mark.skipif(os.environ.get('CI', None) is None,
  17. reason="Doesn't work outside of our CIs")
  18. def test_generate_config():
  19. """jupyter qtconsole --generate-config"""
  20. config_dir = paths.jupyter_config_dir()
  21. check_output([sys.executable, '-m', 'qtconsole', '--generate-config'])
  22. assert os.path.isfile(os.path.join(config_dir,
  23. 'jupyter_qtconsole_config.py'))