PyCQA / redbaron

Bottom-up approach to refactoring in python
http://redbaron.pycqa.org/
694 stars 74 forks source link

Fix tests under pytest 4 #179

Open felixonmars opened 5 years ago

felixonmars commented 5 years ago

Pytest 4 removed support for calling fixtures directly: https://docs.pytest.org/en/latest/deprecations.html#calling-fixtures-directly

This leads to an error when trying to run the tests:

==================================== ERRORS ====================================
_________________ ERROR collecting tests/test_bounding_box.py __________________
Fixture "red" called directly. Fixtures are not meant to be called directly,
but are created automatically when test functions request them as parameters.
See https://docs.pytest.org/en/latest/fixture.html for more information about fixtures, and
https://docs.pytest.org/en/latest/deprecations.html#calling-fixtures-directly about how to update your code.
felixonmars commented 5 years ago

The test failure looks irrelevant.

Hanaasagi commented 5 years ago

It seems to be caused by setuptools.

Ref: https://github.com/pypa/setuptools/issues/1257

mcepl commented 4 years ago

Thank you! Works for on openSUSE/Tumbleweed (and it is a part of the official package now).