ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A

AssertionError: Could not find pytest

I used the below link to build ros2,

when i tried testing and running using,

python src\ament\ament_tools\scripts\ test

python src\ament\ament_tools\scripts\ test_results

i got an error,

Traceback (most recent call last):
File “src\ament\ament_tools\scripts\”, line 161, in
sys.exit(main() or 0)
File “C:\dev\ros2\src\ament\ament_tools\ament_tools\commands\”, line 88, in main
rc = args.main(args)
File “C:\dev\ros2\src\ament\ament_tools\ament_tools\verbs\test\”, line 60, in main
build_main(opts, test_pkg_main_wrapper)
File “C:\dev\ros2\src\ament\ament_tools\ament_tools\verbs\build\”, line 172, in main
return iterate_packages(opts, packages, per_package_main)
File “C:\dev\ros2\src\ament\ament_tools\ament_tools\verbs\build\”, line 300, in iterate_packages
rc = process_sequentially(jobs)
File “C:\dev\ros2\src\ament\ament_tools\ament_tools\verbs\build\”, line 340, in process_sequentially
rc = job’callback’
File “C:\dev\ros2\src\ament\ament_tools\ament_tools\verbs\test\”, line 50, in test_pkg_main_wrapper
rc = test_pkg_main(opts)
File “C:\dev\ros2\src\ament\ament_tools\ament_tools\verbs\test_pkg\”, line 83, in main
handle_build_action(on_test_ret, context)
File “C:\dev\ros2\src\ament\ament_tools\ament_tools\verbs\build_pkg\”, line 268, in handle_build_action
for build_action in build_action_ret:
File “C:\dev\ros2\src\ament\ament_tools\ament_tools\build_types\”, line 118, in on_test
assert pytest, ‘Could not find pytest’
AssertionError: Could not find pytest

Please help me get over this issue. Thanks.

Did you do this line from those instructions?

pip install nose coverage mock pytest pytest-cov pytest-runner