testinfra (1.4.1) incompatible with py.test (3.0.2) (?)
See original GitHub issuewhen 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
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Cannot pass unicode string in parameterized ids with pytest ...
Hi, since #1861 we cannot pass python 2 unicode object to parametrize(): sample ... testinfra (1.4.1) incompatible with py.test (3.0.2) ...
Read more >Testinfra test your infrastructure — testinfra 7.0.2.dev1+ ...
With Testinfra you can write unit tests in Python to test actual state of your servers configured by management tools like Salt, Ansible,...
Read more >testinfra Documentation - Read the Docs
With Testinfra you can write unit tests in Python to test actual state of your servers configured by management tools.
Read more >Debian -- Source Packages in "sid", Subsection misc
... apertium-crh-tur (0.3.0-2); apertium-cy-en (0.1.1~r57554-9); apertium-dan-nor (1.4.1-2) ... corosync-qdevice (3.0.2-1); corsix-th (0.66-1) [contrib] ...
Read more >Change Log — H2O Sparkling Water 3.32.1.4-1-2.4 ...
SW-2571 - Get AutoML Python Tests Alligned with PUBDEV-8175 ... Engineering Story. SW-2536 - Update Spark in Docker Images to 3.0.2.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@philpep Could we pin testinfra to a known working version of pytest? I ended up getting a bug report for this issue too, simply b/c molecule installs testinfra as a dependency. However, testinfra pulls the most current version of pytest.
Could we pin to a known good working version of pytest, this way, when we install a particular version of pytest, it’s known to have been tested against locked deps?
Fixed in 1.4.2