Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing fails against Pytest 5 #6

Closed
stanislavlevin opened this issue Aug 8, 2019 · 0 comments · Fixed by #7
Closed

Testing fails against Pytest 5 #6

stanislavlevin opened this issue Aug 8, 2019 · 0 comments · Fixed by #7

Comments

@stanislavlevin
Copy link
Contributor

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
stanislavlevin added a commit to stanislavlevin/iniconfig that referenced this issue Aug 8, 2019
This fixes
"""
pytest.PytestDeprecationWarning: raises(..., 'code(as_a_string)')
is deprecated, use the context manager form or use `exec()` directly.
"""

Fixes: pytest-dev#6
Signed-off-by: Stanislav Levin <slev@altlinux.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant