# -*- coding: utf-8 -*-

def test_bar_fixture(testdir):
    """Make sure that pytest accepts our fixture."""

    # create a temporary pytest test module
    testdir.makepyfile("""
        def test_sth(bar):
            assert bar == "europython2015"
    """)

    # run pytest with the following cmd args
    result = testdir.runpytest(
        '--foo=europython2015',
        '-v'
    )

    # fnmatch_lines does an assertion internally
    result.stdout.fnmatch_lines([
        '*::test_sth PASSED',
    ])

    # make sure that that we get a '0' exit code for the testsuite
    assert result.ret == 0


def test_help_message(testdir):
    result = testdir.runpytest(
        '--help',
    )
    # fnmatch_lines does an assertion internally
    result.stdout.fnmatch_lines([
        '{{cookiecutter.plugin_name}}:',
        '*--foo=DEST_FOO*Set the value for the fixture "bar".',
    ])

@@ -875,16 +875,621 @@
 %22bar%22.',%0A    %5D)%0A
+%0A%0Adef test_hello_ini_setting(testdir):%0A    testdir.makeini(%22%22%22%0A        %5Bpytest%5D%0A        HELLO = world%0A    %22%22%22)%0A%0A    testdir.makepyfile(%22%22%22%0A        import pytest%0A%0A        @pytest.fixture%0A        def hello(request):%0A            return request.config.getini('HELLO')%0A%0A        def test_hello_world(hello):%0A            assert hello == 'world'%0A    %22%22%22)%0A%0A    result = testdir.runpytest()%0A%0A    # fnmatch_lines does an assertion internally%0A    result.stdout.fnmatch_lines(%5B%0A        '*::test_hello_world PASSED',%0A    %5D)%0A%0A    # make sure that that we get a '0' exit code for the testsuite%0A    assert result.ret == 0%0A

Implement a test for an ini option