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),
openSUSE Build Service is sponsored by