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

Assertions about expected exceptions documentation possible code error #664

Closed
pytestbot opened this issue Jan 20, 2015 · 1 comment
Closed
Labels
type: bug problem that needs to be addressed

Comments

@pytestbot
Copy link
Contributor

Originally reported by: realcr realcr (BitBucket: realcr, GitHub: realcr)


Hi,
I have seen the following piece of code in the documentation at http://pytest.org/latest/assert.html#assert-with-the-assert-statement :

#!python

def test_recursion_depth():
    with pytest.raises(RuntimeError) as excinfo:
        def f():
            f()
        f()
    assert 'maximum recursion' in str(excinfo.value)

I assume that the assert line should be indented one more level to the right. I might be wrong about it though.


@pytestbot
Copy link
Contributor Author

Original comment by realcr realcr (BitBucket: realcr, GitHub: realcr):


I was wrong. The assert shouldn't be indented. I checked it. Sorry :)

@pytestbot pytestbot added the type: bug problem that needs to be addressed label Jun 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug problem that needs to be addressed
Projects
None yet
Development

No branches or pull requests

1 participant