Skip to content

pytest.mark.parameterize "fixture input not found" #695

Closed
@pytestbot

Description

@pytestbot

Originally reported by: Alec Reiter (BitBucket: justanr, GitHub: justanr)


I'm writing tests for a small library and I decided to use py.test after hearing so many good things about it.

However, pytest.mark.parameterize is giving me some issues. At first, I thought maybe I just mismatched some parens and it went off looking for a fixture elsewhere. So I decided to start with the given example of parameterize:

@pytest.mark.parametrize("input,expected", [
    ("3+5", 8),
    ("2+4", 6),
    ("6*9", 42),
])
def test_eval(input, expected):
    assert eval(input) == expected

But this gives the same error:

fixture 'input' not found

available fixtures: capfd, pytestconfig, recwarn, capsys, tmpdir, monkeypatch

use 'py.test --fixtures [testpath]' for help on them.

I went off googling, but I couldn't find any answers that applied. Any ideas on how to approach this?

I'm running Python 3.4.0 and py.test 2.6.4 inside of a virtualenv.


Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions