From 66ffc5e0f8330d189e4113437e87c372ab6c7003 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Mon, 9 Dec 2013 07:07:47 +0100 Subject: [PATCH] backout allowing @pytest.fixture in front of pytest_funcarg__NAME functions. It was introduced because of pylint warnings and it's probably better to go for a pylint-pytest plugin that avoids also other warnings/issues. --- CHANGELOG | 3 --- _pytest/python.py | 5 ++--- testing/python/integration.py | 13 ------------- 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index cf7d71eba..3f3b8eda7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -122,9 +122,6 @@ Unreleased - fix verbose reporting for @mock'd test functions -- allow @pytest.fixture marked pytest_funcarg__foo functions - so that pylint errors can be avoided. - Changes between 2.4.1 and 2.4.2 ----------------------------------- diff --git a/_pytest/python.py b/_pytest/python.py index 5b2b0e774..45996899a 100644 --- a/_pytest/python.py +++ b/_pytest/python.py @@ -1654,9 +1654,8 @@ class FixtureManager: # magic globals with __getattr__ might have got us a wrong # fixture attribute continue - elif name.startswith(self._argprefix): - # let's allso fixture-marked pytest_funcarg__ prefixed functions - name = name[len(self._argprefix):] + else: + assert not name.startswith(self._argprefix) fixturedef = FixtureDef(self, nodeid, name, obj, marker.scope, marker.params, yieldctx=marker.yieldctx, diff --git a/testing/python/integration.py b/testing/python/integration.py index c34f92806..6fbf44572 100644 --- a/testing/python/integration.py +++ b/testing/python/integration.py @@ -195,16 +195,3 @@ class TestReRunTests: def test_pytestconfig_is_session_scoped(): from _pytest.python import pytestconfig assert pytestconfig._pytestfixturefunction.scope == "session" - -def test_funcarg_prefix_and_marker(testdir): - testdir.makepyfile(""" - import pytest - @pytest.fixture - def pytest_funcarg__foo(): - return 1 - - def test_hello(foo): - assert foo == 1 - """) - reprec = testdir.inline_run() - reprec.assertoutcome(passed=1)