Skip to content

Can't run function/method that uses parametrization #23

@sloria

Description

@sloria

To reproduce:

Given the following code:

import pytest

@pytest.mark.parametrize(('inp', 'expected'),
[
    ('2 + 2', 4),
    ('0 + 0', 0),
    ('2 + 2.0', 4.0),
])
def test_adding(inp, expected):
    assert eval(inp) == expected

Executing :Pytest function verbose results in the following error.

============================================================================================ test session starts ============================================================================================
platform darwin -- Python 3.4.2 -- py-1.4.26 -- pytest-2.6.4 -- /Users/sloria/miniconda/envs/fresh/bin/python3
plugins: xdist
collecting ... 
=============================================================================================  in 0.01 seconds ==============================================================================================
ERROR: not found: /Users/sloria/projects/python-projects/t.py::test_adding
(no name '/Users/sloria/projects/python-projects/t.py::test_adding' in any of [<Module 't.py'>])

Note: :Pytest file works fine. However, it'd be very nice to run paramerized test functions and methods in isolation.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions