問題
pytestを実行しようとすると、身に覚えのない以下のようなエラーが発生する。
AttributeError: 'Function' object has no attribute 'get_marker'
解決法
pytestのissuesでまさにこの問題が取り上げられていました。
AttributeError: 'Function' object has no attribute 'get_marker' · Issue #252 · pytest-dev/pytest-cov
Ijuststartedgettingthefollowingerrorwithpytest-covv2.6.0,pytestv4.1.0onPython3.4.6,PyPy,andPyPy3self=,item=
長いスレッドになっていますが、私の環境(pytest-5.0.1を使用)では以下のコマンドによりエラーを解消できました。
> conda install pytest
> pip install "pytest-remotedata>=0.3.1"
どなたかのご参考になりましたら幸いです。
pytestを使ってPythonでテスト駆動開発するための全知識。本書の目的 ・Pythonを使っているのでpytestを使ったテスト駆動開発する ・シンプルなテストをシンプルに書く ・複雑なテストもシンプルに書く ・読みやすいテストを書く
コメント