--- you can reply above this line ---

New issue 202: Float numbers in parametrize are rendered wrongly in test name
https://bitbucket.org/hpk42/pytest/issue/202/float-numbers-in-parametrize-are-rendered

Brianna Laugher:

    #!python
    @py.test.mark.parametrize(("myInt", "myFloat"), [
        (1, 1.0),
        (2, 2.0),
    ])
    def test_floatsInTestNameAreStrange(myInt, myFloat):
    print
    print "myInt=", myInt
    print "myFloat=", myFloat
    assert myInt == myFloat


output:
   
    #!shell
    ===== test session starts =====
    test_foo.py:415: test_floatsInTestNameAreStrange[1-.1] 
    myInt= 1
    myFloat= 1.0
    PASSED
    test_foo.py:415: test_floatsInTestNameAreStrange[2-.3] 
    myInt= 2
    myFloat= 2.0
    PASSED


As you can see the correct values are received in the test, but for some reason 
1.0 appears as ".1" in the test name, and 2.0 appears as ".3".

This is with py.test 2.2.3.


--

This is an issue notification from bitbucket.org. You are receiving
this either because you are the owner of the issue, or you are
following the issue.
_______________________________________________
py-dev mailing list
py-dev@codespeak.net
http://codespeak.net/mailman/listinfo/py-dev

Reply via email to