Simplify the logic run for pytest version inside the venv#501
Simplify the logic run for pytest version inside the venv#501
Conversation
Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
| # check_output capabilities | ||
| pytest_6_version_file = os.path.join(args.buildspace, 'pytest6_version_result.txt') | ||
| job.run(["%s -c 'import pytest; print(pytest.__version__)' > %s" % (job.python, pytest_6_version_file)]) | ||
| pytest_6_or_greater = False |
There was a problem hiding this comment.
if we define the variable only inside the with clause, could it be used outside of that scope?
|
This is confusing me: the test display to be using pytest-6.0.1, I've verified that this information is being generated fine in this PR and goes to the temporary file. Some lines after this message appear |
Don't have more time to investigate what's going on with the pytest enviroment, an alternative to these changes that seems not to fix the problem is pr #502 |
|
It does seem odd. Locally, I can reproduce the test warning with pytest 6.0.1 building ament_package |
|
After some reading and experimentation, I think we should expect the deprecation warnings to appear if The problem here is that we're assuming if Unless there's some reason we shouldn't always set |
Mostly inspired by this comment of @dirk-thomas #498 (comment). Should help to ix the regressions found in #498.
Implementation: print the pytest version inside the venv using job.run and move the version check logic outside of the venv.
Tested with
ament_packageon Foxy in: