pytestでAttributeError: ‘Function’ object has no attribute ‘get_marker’が発生するときの解決法

問題

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
I just started getting the following error with pytest-cov v2.6.0, pytest v4.1.0 on Python 3.4.6, PyPy, and PyPy3 self = , item =

長いスレッドになっていますが、私の環境(pytest-5.0.1を使用)では以下のコマンドによりエラーを解消できました。

> conda install pytest
> pip install "pytest-remotedata>=0.3.1"

どなたかのご参考になりましたら幸いです。

pytestを使ってPythonでテスト駆動開発するための全知識。本書の目的 ・Pythonを使っているのでpytestを使ったテスト駆動開発する ・シンプルなテストをシンプルに書く ・複雑なテストもシンプルに書く ・読みやすいテストを書く

コメント