Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: print an error if repo name is not found #27

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pytest_mergify/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ def pytest_terminal_summary(
)
return

if self.mergify_tracer.repo_name is None:
terminalreporter.write_line(
"Unable to determine repository name; test results will not be uploaded",
red=True,
)
return

if self.mergify_tracer.interceptor is None:
terminalreporter.write_line("Nothing to do")
else:
Expand Down
5 changes: 4 additions & 1 deletion tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ def test_foo():
)
result = pytester.runpytest_subprocess()
result.assert_outcomes(passed=1)
assert "Nothing to do" in result.stdout.lines
assert (
"Unable to determine repository name; test results will not be uploaded"
in result.stdout.lines
)


def test_errors_logs(
Expand Down