fix erroring doc example
This commit is contained in:
		
							parent
							
								
									89badfec0c
								
							
						
					
					
						commit
						5ff75a41ea
					
				|  | @ -476,7 +476,7 @@ We can run this:: | ||||||
|     file $REGENDOC_TMPDIR/b/test_error.py, line 1 |     file $REGENDOC_TMPDIR/b/test_error.py, line 1 | ||||||
|       def test_root(db):  # no db here, will error out |       def test_root(db):  # no db here, will error out | ||||||
|             fixture 'db' not found |             fixture 'db' not found | ||||||
|             available fixtures: record_xml_property, tmpdir_factory, tmpdir, monkeypatch, pytestconfig, cache, capsys, capfd, recwarn |             available fixtures: recwarn, monkeypatch, cache, tmpdir_factory, tmpdir, record_xml_property, capfd, capsys, pytestconfig | ||||||
|             use 'py.test --fixtures [testpath]' for help on them. |             use 'py.test --fixtures [testpath]' for help on them. | ||||||
|      |      | ||||||
|     $REGENDOC_TMPDIR/b/test_error.py:1 |     $REGENDOC_TMPDIR/b/test_error.py:1 | ||||||
|  |  | ||||||
|  | @ -180,7 +180,7 @@ function (in or below the directory where ``conftest.py`` is located):: | ||||||
|     def test_ehlo(smtp): |     def test_ehlo(smtp): | ||||||
|         response, msg = smtp.ehlo() |         response, msg = smtp.ehlo() | ||||||
|         assert response == 250 |         assert response == 250 | ||||||
|         assert "smtp.gmail.com" in str(msg, 'ascii') |         assert "smtp.gmail.com" in msg | ||||||
|         assert 0  # for demo purposes    |         assert 0  # for demo purposes    | ||||||
| 
 | 
 | ||||||
|     def test_noop(smtp): |     def test_noop(smtp): | ||||||
|  | @ -207,10 +207,11 @@ inspect what is going on and can now run the tests:: | ||||||
|         def test_ehlo(smtp): |         def test_ehlo(smtp): | ||||||
|             response, msg = smtp.ehlo() |             response, msg = smtp.ehlo() | ||||||
|             assert response == 250 |             assert response == 250 | ||||||
|     >       assert "smtp.gmail.com" in str(msg, 'ascii') |             assert "smtp.gmail.com" in msg | ||||||
|     E       TypeError: str() takes at most 1 argument (2 given) |     >       assert 0  # for demo purposes | ||||||
|  |     E       assert 0 | ||||||
|      |      | ||||||
|     test_module.py:5: TypeError |     test_module.py:6: AssertionError | ||||||
|     _______ test_noop ________ |     _______ test_noop ________ | ||||||
|      |      | ||||||
|     smtp = <smtplib.SMTP instance at 0xdeadbeef> |     smtp = <smtplib.SMTP instance at 0xdeadbeef> | ||||||
|  | @ -387,10 +388,11 @@ So let's just do another run:: | ||||||
|         def test_ehlo(smtp): |         def test_ehlo(smtp): | ||||||
|             response, msg = smtp.ehlo() |             response, msg = smtp.ehlo() | ||||||
|             assert response == 250 |             assert response == 250 | ||||||
|     >       assert "smtp.gmail.com" in str(msg, 'ascii') |             assert "smtp.gmail.com" in msg | ||||||
|     E       TypeError: str() takes at most 1 argument (2 given) |     >       assert 0  # for demo purposes | ||||||
|  |     E       assert 0 | ||||||
|      |      | ||||||
|     test_module.py:5: TypeError |     test_module.py:6: AssertionError | ||||||
|     _______ test_noop[smtp.gmail.com] ________ |     _______ test_noop[smtp.gmail.com] ________ | ||||||
|      |      | ||||||
|     smtp = <smtplib.SMTP instance at 0xdeadbeef> |     smtp = <smtplib.SMTP instance at 0xdeadbeef> | ||||||
|  | @ -409,10 +411,10 @@ So let's just do another run:: | ||||||
|         def test_ehlo(smtp): |         def test_ehlo(smtp): | ||||||
|             response, msg = smtp.ehlo() |             response, msg = smtp.ehlo() | ||||||
|             assert response == 250 |             assert response == 250 | ||||||
|     >       assert "smtp.gmail.com" in str(msg, 'ascii') |     >       assert "smtp.gmail.com" in msg | ||||||
|     E       TypeError: str() takes at most 1 argument (2 given) |     E       assert 'smtp.gmail.com' in 'mail.python.org\nSIZE 51200000\nETRN\nSTARTTLS\nENHANCEDSTATUSCODES\n8BITMIME\nDSN\nSMTPUTF8' | ||||||
|      |      | ||||||
|     test_module.py:5: TypeError |     test_module.py:5: AssertionError | ||||||
|     -------------------------- Captured stdout setup --------------------------- |     -------------------------- Captured stdout setup --------------------------- | ||||||
|     finalizing <smtplib.SMTP instance at 0xdeadbeef> |     finalizing <smtplib.SMTP instance at 0xdeadbeef> | ||||||
|     _______ test_noop[mail.python.org] ________ |     _______ test_noop[mail.python.org] ________ | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue