Skip to content

testinfra (1.4.1) incompatible with py.test (3.0.2) (?) #125

Closed
@Heiko-san

Description

@Heiko-san

when upgrading to the latest version of testinfra with the lastest version of py.test (see above) it seems parametrization is broken:

def test_work(File):
    assert True

testinfra test.py

================================================================================================ test session starts ================================================================================================
platform linux2 -- Python 2.7.6, pytest-3.0.2, py-1.4.31, pluggy-0.3.1
rootdir: /, inifile: 
plugins: testinfra-1.4.1
collected 0 items / 1 errors 

====================================================================================================== ERRORS =======================================================================================================
_____________________________________________________________________________________________ ERROR collecting /test.py _____________________________________________________________________________________________
usr/local/lib/python2.7/dist-packages/testinfra/plugin.py:128: in pytest_generate_tests
    "_testinfra_backend", params, ids=ids, scope="module")
usr/local/lib/python2.7/dist-packages/_pytest/python.py:837: in parametrize
    raise ValueError(msg % (saferepr(id_value), type(id_value).__name__))
E   ValueError: ids must be list of strings, found: 'local' (type: unicode)
============================================================================================== pytest-warning summary ===============================================================================================
WP1 None Modules are already imported so can not be re-written: testinfra
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
==================================================================================== 1 pytest-warnings, 1 error in 0.22 seconds =====================================================================================

when downgrading py.test to 3.0.1 everything works fine

when parameters are left away it will also work:

def test_work():
    assert True

we could reproduce the issue on the following os using native python (python2) with testrinfra installed via pip:

  • debian 7,8
  • ubuntu 1204,1404,1604
  • centos 5,6,7
  • sles 11.4,12.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue/PR relates to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions