Skip to content

Conversation

@amilcarlucas
Copy link
Collaborator

Non-production code is only used in development and testing

Non-production code is only used in development and testing
Copilot AI review requested due to automatic review settings January 7, 2026 23:36
@amilcarlucas amilcarlucas merged commit 0444ced into master Jan 7, 2026
25 of 29 checks passed
@amilcarlucas amilcarlucas deleted the ignore_coverage_in_non_production_code branch January 7, 2026 23:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds # pragma: no cover comments to exclude command-line entry point functions from test coverage tracking. The PR description states these functions are only used in development and testing, not in production.

Key changes:

  • Adds coverage exclusion pragmas to argument_parser(), main(), and if __name__ == "__main__": blocks
  • Affects 9 frontend_tkinter module files that provide standalone testing/development entry points

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
frontend_tkinter_template_overview.py Adds coverage exclusions to argument parser, main function, and entry point
frontend_tkinter_stage_progress.py Adds coverage exclusions to argument parser, main function, and entry point
frontend_tkinter_project_opener.py Adds coverage exclusions to argument parser, main function, and entry point
frontend_tkinter_project_creator.py Adds coverage exclusions to argument parser, main function, and entry point
frontend_tkinter_parameter_editor.py Adds coverage exclusions to argument parser and entry point
frontend_tkinter_pair_tuple_combobox.py Adds coverage exclusions to argument parser, main function, and entry point
frontend_tkinter_motor_test.py Adds coverage exclusions to argument parser, main function, and entry point
frontend_tkinter_connection_selection.py Adds coverage exclusions to argument parser, main function, and entry point
frontend_tkinter_component_editor_base.py Adds coverage exclusion to entry point
frontend_tkinter_component_editor.py Adds coverage exclusion to entry point



def argument_parser() -> argparse.Namespace:
def argument_parser() -> argparse.Namespace: # pragma: no cover
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The argument_parser function should not be excluded from coverage. This function is tested in tests/test_frontend_tkinter_template_overview.py (see test_argument_parser_loglevel_options), and excluding it from coverage will hide the fact that it has test coverage. Remove the pragma comment to allow coverage tracking for this tested function.

Copilot uses AI. Check for mistakes.


def main() -> None:
def main() -> None: # pragma: no cover
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main function should not be excluded from coverage. This function is tested in tests/test_frontend_tkinter_template_overview.py (see test_main_function_logs_recently_used_directory_when_available and test_main_function_handles_no_recently_used_directories), and excluding it from coverage will hide the fact that it has test coverage. Remove the pragma comment to allow coverage tracking for this tested function.

Copilot uses AI. Check for mistakes.


if __name__ == "__main__":
if __name__ == "__main__": # pragma: no cover
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The if __name__ == "__main__" block should not be excluded from coverage. While this is typically used as an entry point, excluding it without evidence that it's never used in production or that tests exist that should bypass it is premature. Since the main() function it calls is tested, the coverage tool should be able to track whether this entry point is ever executed during testing.

Copilot uses AI. Check for mistakes.


def argument_parser() -> Namespace:
def argument_parser() -> Namespace: # pragma: no cover
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The argument_parser function should not be excluded from coverage. This function is tested in tests/test_frontend_tkinter_motor_test.py (see test_argument_parser_wires_common_arguments), and excluding it from coverage will hide the fact that it has test coverage. Remove the pragma comment to allow coverage tracking for this tested function.

Copilot uses AI. Check for mistakes.

# pylint: disable=duplicate-code
def main() -> None:
def main() -> None: # pragma: no cover
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main function should not be excluded from coverage. This function is tested in tests/test_frontend_tkinter_motor_test.py (see test_main_success_and_failure_paths), and excluding it from coverage will hide the fact that it has test coverage. Remove the pragma comment to allow coverage tracking for this tested function.

Copilot uses AI. Check for mistakes.


if __name__ == "__main__":
if __name__ == "__main__": # pragma: no cover
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The if __name__ == "__main__" block should not be excluded from coverage. While this is typically used as an entry point, excluding it without evidence that it's never used in production or that tests exist that should bypass it is premature. Since the main() function it calls is tested, the coverage tool should be able to track whether this entry point is ever executed during testing.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants