How to use the dagit.cli.host_dagit_ui function in dagit

To help you get started, we’ve selected a few dagit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dagster-io / dagster / python_modules / dagit / dagit_tests / test_app.py View on Github external
def test_port_collision():
    def _raise_os_error():
        raise OSError('Address already in use')

    with mock.patch('gevent.pywsgi.WSGIServer', new=_define_mock_server(_raise_os_error)):
        handle = ExecutionTargetHandle.for_repo_yaml(script_relative_path('./repository.yaml'))
        with pytest.raises(Exception) as exc_info:
            host_dagit_ui(handle=handle, host=None, port=2343)

        assert 'Another process ' in str(exc_info.value)
github dagster-io / dagster / python_modules / dagit / dagit_tests / test_app.py View on Github external
def test_unknown_error():
    class AnException(Exception):
        pass

    def _raise_custom_error():
        raise AnException('foobar')

    with mock.patch('gevent.pywsgi.WSGIServer', new=_define_mock_server(_raise_custom_error)):
        handle = ExecutionTargetHandle.for_repo_yaml(script_relative_path('./repository.yaml'))
        with pytest.raises(AnException):
            host_dagit_ui(handle=handle, host=None, port=2343)
github dagster-io / dagster / python_modules / dagit / dagit_tests / test_app.py View on Github external
def test_successful_host_dagit_ui():
    with mock.patch('gevent.pywsgi.WSGIServer'):
        handle = ExecutionTargetHandle.for_repo_yaml(script_relative_path('./repository.yaml'))
        host_dagit_ui(handle=handle, host=None, port=2343)