LoginSignup
1
0

【ROS2 colcon test】pythonパッケージのcolcon testで、consider_namespace_packagesエラーとなる場合の対処方法

Last updated at Posted at 2024-04-01

はじめに

 ROS2のPythonパッケージで、colcon testコマンドによるpytestを用いたPythonの単体テスト実行時に下記のエラーとなった。今までは成功していたが、pytest8.1.0での仕様変更の影響でエラーとなる。

ERROR test - TypeError: import_path() missing 1 required keyword-only argument: 'consider_namespace_packages'

 Humbleでは下記のように対策が取られるようだが(2024.4.1現在)、EOFであるFoxyは公式には対処されないので、エラーの回避方法を紹介する。

動作確認環境

  • ROS2 Foxy

エラー対処方法

pytestのバージョンを、8.1.0より前のバージョンに変更する。

pip install 'pytest<8.1.0'

参考までに、pytestのバージョンの違いによるcolcon test時のエラーの有無を示す。

pytestバージョン 結果
8.1.1 NG
8.1.0 NG
8.0.2 OK
8.0.1 OK
8.0.0 OK
7.4.4 OK

参考

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0