|
0 |
From: Sophie Brun <[email protected]>
|
|
1 |
Date: Fri, 5 Feb 2021 12:17:41 +0100
|
|
2 |
Subject: Fix for pytest 6
|
|
3 |
|
|
4 |
Origin: https://github.com/pytest-dev/pytest-factoryboy/commit/a873a8f5d101d4d3d7956c2b4e9d15b28b98c3f5
|
|
5 |
---
|
|
6 |
pytest_factoryboy/plugin.py | 6 ++----
|
|
7 |
1 file changed, 2 insertions(+), 4 deletions(-)
|
|
8 |
|
|
9 |
diff --git a/pytest_factoryboy/plugin.py b/pytest_factoryboy/plugin.py
|
|
10 |
index d70f2e3..fb143cc 100644
|
|
11 |
--- a/pytest_factoryboy/plugin.py
|
|
12 |
+++ b/pytest_factoryboy/plugin.py
|
|
13 |
@@ -113,9 +113,7 @@ def pytest_runtest_call(item):
|
|
14 |
def pytest_addhooks(pluginmanager):
|
|
15 |
"""Register plugin hooks."""
|
|
16 |
from pytest_factoryboy import hooks
|
|
17 |
- # addhooks is for older py.test and deprecated; replaced by add_hookspecs
|
|
18 |
- add_hookspecs = getattr(pluginmanager, 'add_hookspecs', pluginmanager.addhooks)
|
|
19 |
- add_hookspecs(hooks)
|
|
20 |
+ pluginmanager.add_hookspecs(hooks)
|
|
21 |
|
|
22 |
|
|
23 |
def pytest_generate_tests(metafunc):
|
|
24 |
@@ -124,4 +122,4 @@ def pytest_generate_tests(metafunc):
|
|
25 |
fixturedef = arg2fixturedef[-1]
|
|
26 |
related.extend(getattr(fixturedef.func, "_factoryboy_related", []))
|
|
27 |
|
|
28 |
- metafunc.funcargnames.extend(related)
|
|
29 |
+ metafunc.fixturenames.extend(related)
|