Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
edublancas committed Mar 6, 2022
1 parent 765d159 commit 61a1a55
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/ploomber/exceptions.py
Expand Up @@ -52,7 +52,7 @@ class DAGRenderError(Exception):
@cli_endpoint decorator)
"""
def __init__(self, message):
message = message + 'Need help? https://ploomber.io/community'
message = message + '\nNeed help? https://ploomber.io/community'
super().__init__(message)


Expand All @@ -67,7 +67,7 @@ class DAGBuildError(Exception):
@cli_endpoint decorator)
"""
def __init__(self, message):
message = message + 'Need help? https://ploomber.io/community'
message = message + '\nNeed help? https://ploomber.io/community'
super().__init__(message)


Expand Down
2 changes: 1 addition & 1 deletion tests/cli/test_parsers.py
Expand Up @@ -235,7 +235,7 @@ def test_custom_parser_error_if_unable_to_automatically_locate_entry_point(
captured = capsys.readouterr()

assert excinfo.value.code == 2
assert 'Unable to find a pipeline entry point' in captured.err
assert 'Unable to find a pipeline' in captured.err


def test_error_if_missing_entry_point_value(monkeypatch, capsys):
Expand Down
9 changes: 6 additions & 3 deletions tests/dag/test_dag.py
Expand Up @@ -910,7 +910,8 @@ def test_on_render_crashes(tmp_directory):
with pytest.raises(DAGRenderError) as excinfo:
dag.build()

msg = 'Exception when running on_render for DAG "No name": crash!'
msg = ('Exception when running on_render for DAG "No name": crash!'
'\nNeed help? https://ploomber.io/community')
assert str(excinfo.value) == msg
assert 'crash!' in str(excinfo.getrepr())
assert dag._exec_status == DAGStatus.ErroredRender
Expand All @@ -936,7 +937,8 @@ def test_on_finish_crashes(tmp_directory):
with pytest.raises(DAGBuildError) as excinfo:
dag.build()

msg = 'Exception when running on_finish for DAG "No name": crash!'
msg = ('Exception when running on_finish for DAG "No name": crash!'
'\nNeed help? https://ploomber.io/community')
assert str(excinfo.value) == msg
assert 'crash!' in str(excinfo.getrepr())
assert dag._exec_status == DAGStatus.Errored
Expand Down Expand Up @@ -976,7 +978,8 @@ def test_on_failure_crashes(caplog):
dag.build()

assert hook_crashing.count == 1
msg = 'Exception when running on_failure for DAG "dag": crash!'
msg = ('Exception when running on_failure for DAG "dag": crash!'
'\nNeed help? https://ploomber.io/community')
assert str(excinfo.value) == msg
assert 'crash!' in str(excinfo.getrepr())
assert dag._exec_status == DAGStatus.Errored
Expand Down

0 comments on commit 61a1a55

Please sign in to comment.