Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
devel:languages:python
python-redbaron
pytest4.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File pytest4.patch of Package python-redbaron
From 812081b7bd8774ceb61016ac37da43107c26eea2 Mon Sep 17 00:00:00 2001 From: Felix Yan <felixonmars@archlinux.org> Date: Mon, 18 Feb 2019 02:15:55 +0800 Subject: [PATCH] Fix tests under pytest 4 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. ``` --- tests/test_bounding_box.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_bounding_box.py b/tests/test_bounding_box.py index f04c6da..e62a1ca 100644 --- a/tests/test_bounding_box.py +++ b/tests/test_bounding_box.py @@ -8,7 +8,6 @@ from redbaron import RedBaron -@pytest.fixture def red(): return RedBaron("""\ @deco @@ -17,6 +16,11 @@ def a(c, d): """) +@pytest.fixture(name="red") +def red_fixture(): + return red() + + fst = red() bounding_boxes = [ (((1, 1), (4, 0)), ((1, 1), (4, 0)), fst),
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor