Skip to content
Merged
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
3 changes: 2 additions & 1 deletion ros2_batch_job/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,8 @@ def build_and_test(args, job):
'import pytest;'
'import sys;'
'sys.exit(StrictVersion(pytest.__version__) >= StrictVersion("6.0.0"))'
"'"])
"'"],
exit_on_error=False)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Using the return value for both the version comparison result as well as potential errors looks fragile to me. I would suggest to refactor this logic to:

  • either print the version comparison result (and interpret the output) and ensure that the command has a return code of zero
  • or just print pytest.__version__ and perform the comparison in the calling Python code rather than within the invoked command.

for path in Path('.').rglob('pytest.ini'):
config = configparser.ConfigParser()
config.read(str(path))
Expand Down