Differential D4920 Diff 24623 python_modules/dagster/dagster_tests/general_tests/grpc_tests/test_persistent.py
Changeset View
Changeset View
Standalone View
Standalone View
python_modules/dagster/dagster_tests/general_tests/grpc_tests/test_persistent.py
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | try: | ||||
with pytest.raises(DagsterIPCProtocolError): | with pytest.raises(DagsterIPCProtocolError): | ||||
wait_for_grpc_server(ipc_output_file) | wait_for_grpc_server(ipc_output_file) | ||||
_, err = capfd.readouterr() | _, err = capfd.readouterr() | ||||
assert "No module named" in err | assert "No module named" in err | ||||
finally: | finally: | ||||
process.terminate() | process.terminate() | ||||
def test_load_with_non_existant_file(capfd): | |||||
port = find_free_port() | |||||
# File that will fail if working directory isn't set to default | |||||
python_file = file_relative_path(__file__, "made_up_file_does_not_exist.py") | |||||
with pytest.raises(subprocess.CalledProcessError): | |||||
subprocess.check_output( | |||||
["dagster", "api", "grpc", "--port", str(port), "--python-file", python_file], | |||||
) | |||||
_, err = capfd.readouterr() | |||||
assert "No such file or directory" in err | |||||
def test_load_with_empty_working_directory(capfd): | def test_load_with_empty_working_directory(capfd): | ||||
port = find_free_port() | port = find_free_port() | ||||
# File that will fail if working directory isn't set to default | # File that will fail if working directory isn't set to default | ||||
python_file = file_relative_path(__file__, "grpc_repo_with_local_import.py") | python_file = file_relative_path(__file__, "grpc_repo_with_local_import.py") | ||||
with new_cwd(os.path.dirname(__file__)): | with new_cwd(os.path.dirname(__file__)): | ||||
ipc_output_file = _get_ipc_output_file() | ipc_output_file = _get_ipc_output_file() | ||||
▲ Show 20 Lines • Show All 112 Lines • Show Last 20 Lines |