Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
state
  • Loading branch information
RonnyPfannschmidt committed Aug 2, 2020
commit 1a4e4f3b8953261c126c0ef509c55f91d52c46b5
19 changes: 19 additions & 0 deletions testing/example_scripts/fixtures/plugin_properties/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import warnings

import pytest


class FunPlugin:
@property
def shouldnt_warn(self):
warnings.warn("i_shouldnt_happen")
print("if no warning but thus, then all is bad")

@pytest.fixture
def fix(self):
pass


def pytest_configure(config):
warnings.simplefilter("always", DeprecationWarning)
config.pluginmanager.register(FunPlugin(), "fun")
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test_fun(fix):
pass
8 changes: 6 additions & 2 deletions testing/python/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -1350,8 +1350,7 @@ def test_printer_2(self):

class TestFixtureManagerParseFactories:
@pytest.fixture
def testdir(self, request):
testdir = request.getfixturevalue("testdir")
def testdir(self, testdir):
testdir.makeconftest(
"""
import pytest
Expand Down Expand Up @@ -1572,6 +1571,11 @@ def test_collect_custom_items(self, testdir):
result = testdir.runpytest("foo")
result.stdout.fnmatch_lines(["*passed*"])

def test_plugin_properties_are_skipped(self, testdir):
testdir.copy_example("fixtures/plugin_properties")
result = testdir.runpytest("-s", "-k", "fun")
result.stdout.fnmatch_lines(["*passed*"])


class TestAutouseDiscovery:
@pytest.fixture
Expand Down