pytest-dev / iniconfig

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Testing fails against Pytest 5

stanislavlevin opened this issue · comments

I run this package test suite against Pytest 5:

4 failed, 38 passed

There are several identical errors:

=================================== FAILURES ===================================
___________________________ test_iniconfig_from_file ___________________________

tmpdir = local('/usr/src/tmp/pytest-of-builder/pytest-1/test_iniconfig_from_file0')

    def test_iniconfig_from_file(tmpdir):
        path = tmpdir/'test.txt'
        path.write('[metadata]\nname=1')
    
        config = IniConfig(path=path)
        assert list(config.sections) == ['metadata']
        config = IniConfig(path, "[diff]")
        assert list(config.sections) == ['diff']
>       py.test.raises(TypeError, "IniConfig(data=path.read())")
E       pytest.PytestDeprecationWarning: raises(..., 'code(as_a_string)') is deprecated, use the context manager form or use `exec()` directly
E       
E       See https://docs.pytest.org/en/latest/deprecations.html#raises-warns-exec

test_iniconfig.py:153: PytestDeprecationWarning