Results of doctest builder run on 2013-03-20 18:54:40 ===================================================== Document: tutorial/inputoutput ------------------------------ 1 items passed all tests: 2 tests in default 2 tests in 1 items. 2 passed and 0 failed. Test passed. Document: library/urllib.parse ------------------------------ ********************************************************************** File "library/urllib.parse.rst", line ?, in default Failed example: urlparse('//www.cwi.nl:80/%7Eguido/Python.html') Expected: ParseResult(scheme='', netloc='www.cwi.nl:80', path='/%7Eguido/Python.html', params='', query='', fragment='') Got: ParseResult(scheme='', netloc='www.cwi.nl:80', path='/%7Eguido/Python.html', params='', query='', fragment='') ********************************************************************** File "library/urllib.parse.rst", line ?, in default Failed example: urlparse('www.cwi.nl/%7Eguido/Python.html') Expected: ParseResult(scheme='', netloc='', path='www.cwi.nl:80/%7Eguido/Python.html', params='', query='', fragment='') Got: ParseResult(scheme='', netloc='', path='www.cwi.nl/%7Eguido/Python.html', params='', query='', fragment='') ********************************************************************** File "library/urllib.parse.rst", line ?, in default Failed example: urlparse('help/Python.html') Expected: ParseResult(scheme='', netloc='', path='help/Python.html', params='', query='', fragment='') Got: ParseResult(scheme='', netloc='', path='help/Python.html', params='', query='', fragment='') ********************************************************************** 1 items had failures: 3 of 19 in default 19 tests in 1 items. 16 passed and 3 failed. ***Test Failed*** 3 failures. Document: library/fractions --------------------------- 1 items passed all tests: 8 tests in default 8 tests in 1 items. 8 passed and 0 failed. Test passed. Document: library/weakref ------------------------- 1 items passed all tests: 8 tests in default 8 tests in 1 items. 8 passed and 0 failed. Test passed. Document: library/turtle ------------------------ 1 items passed all tests: 313 tests in default 313 tests in 1 items. 313 passed and 0 failed. Test passed. Document: library/pprint ------------------------ 1 items passed all tests: 14 tests in default 14 tests in 1 items. 14 passed and 0 failed. Test passed. Document: library/functools --------------------------- 1 items passed all tests: 10 tests in default 10 tests in 1 items. 10 passed and 0 failed. Test passed. Document: library/configparser ------------------------------ ********************************************************************** File "library/configparser.rst", line 114, in default Failed example: for key in config['bitbucket.org']: print(key) Expected: user compressionlevel serveraliveinterval compression forwardx11 Got: user serveraliveinterval compression compressionlevel forwardx11 ********************************************************************** File "library/configparser.rst", line 465, in default Failed example: parser.sections() Expected: ['section3', 'section2', 'section1'] Got: ['section2', 'section3', 'section1'] ********************************************************************** File "library/configparser.rst", line 467, in default Failed example: [option for option in parser['section3']] Expected: ['baz', 'foo', 'bar'] Got: ['bar', 'foo', 'baz'] ********************************************************************** File "library/configparser.rst", line 740, in default Failed example: typical = ConfigParser() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in typical = ConfigParser() NameError: name 'ConfigParser' is not defined ********************************************************************** File "library/configparser.rst", line 742, in default Failed example: typical.sections() Expected: ['Section 1', ' Section 2 '] Got: ['Section1', 'Section2', 'Section 1', ' Section 2 '] ********************************************************************** File "library/configparser.rst", line 744, in default Failed example: custom = ConfigParser() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in custom = ConfigParser() NameError: name 'ConfigParser' is not defined ********************************************************************** File "library/configparser.rst", line 745, in default Failed example: custom.SECTCRE = re.compile(r"\[ *(?P
[^]]+?) *\]") Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in custom.SECTCRE = re.compile(r"\[ *(?P
[^]]+?) *\]") NameError: name 're' is not defined ********************************************************************** File "library/configparser.rst", line 747, in default Failed example: custom.sections() Expected: ['Section 1', 'Section 2'] Got: ['Section1', 'Section2', 'Section 1', ' Section 2 '] ********************************************************************** 1 items had failures: 8 of 80 in default 80 tests in 1 items. 72 passed and 8 failed. ***Test Failed*** 8 failures. Document: library/unittest.mock-examples ---------------------------------------- ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: real = SomeClass() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in real = SomeClass() NameError: name 'SomeClass' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: real.method = MagicMock(name='method') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in real.method = MagicMock(name='method') NameError: name 'MagicMock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: real.method(3, 4, 5, key='value') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in real.method(3, 4, 5, key='value') NameError: name 'real' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: real.something = MagicMock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in real.something = MagicMock() NameError: name 'MagicMock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: real.something.assert_called_once_with(1, 2, 3) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in real.something.assert_called_once_with(1, 2, 3) AttributeError: 'function' object has no attribute 'assert_called_once_with' ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock = Mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock() NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: real.closer(mock) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in real.closer(mock) NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock.close.assert_called_with() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.close.assert_called_with() NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: with patch('module.Foo') as mock: instance = mock.return_value instance.method.return_value = 'the result' result = some_function() assert result == 'the result' Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in with patch('module.Foo') as mock: NameError: name 'patch' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock = MagicMock(name='foo') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = MagicMock(name='foo') NameError: name 'MagicMock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock.method Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.method NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock = MagicMock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = MagicMock() NameError: name 'MagicMock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock.method() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.method() NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock.attribute.method(10, x=53) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.attribute.method(10, x=53) NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock.mock_calls Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.mock_calls NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: expected = [call.method(), call.attribute.method(10, x=53)] Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in expected = [call.method(), call.attribute.method(10, x=53)] NameError: name 'call' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock.mock_calls == expected Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.mock_calls == expected NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock = Mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock() NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock.return_value = 3 Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.return_value = 3 NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock() NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock = Mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock() NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock.method.return_value = 3 Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.method.return_value = 3 NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock.method() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.method() NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock = Mock(return_value=3) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock(return_value=3) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock() NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock = Mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock() NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock.x = 3 Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.x = 3 NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock.x Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.x NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock = Mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock() NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: cursor = mock.connection.cursor.return_value Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in cursor = mock.connection.cursor.return_value NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: cursor.execute.return_value = ['foo'] Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in cursor.execute.return_value = ['foo'] NameError: name 'cursor' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock.connection.cursor().execute("SELECT 1") Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.connection.cursor().execute("SELECT 1") NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: expected = call.connection.cursor().execute("SELECT 1").call_list() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in expected = call.connection.cursor().execute("SELECT 1").call_list() NameError: name 'call' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock.mock_calls Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.mock_calls NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock.mock_calls == expected Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.mock_calls == expected NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock = Mock(side_effect=Exception('Boom!')) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock(side_effect=Exception('Boom!')) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock() Expected: Traceback (most recent call last): ... Exception: Boom! Got: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock() NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock = MagicMock(side_effect=[4, 5, 6]) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = MagicMock(side_effect=[4, 5, 6]) NameError: name 'MagicMock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock() NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock() NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock() NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock = MagicMock(side_effect=side_effect) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = MagicMock(side_effect=side_effect) NameError: name 'MagicMock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock(1, 2) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock(1, 2) NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock(2, 3) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock(2, 3) NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock = Mock(spec=SomeClass) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock(spec=SomeClass) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock.old_method() Expected: Traceback (most recent call last): ... AttributeError: object has no attribute 'old_method' Got: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.old_method() NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: original = SomeClass.attribute Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in original = SomeClass.attribute NameError: name 'SomeClass' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: @patch.object(SomeClass, 'attribute', sentinel.attribute) def test(): assert SomeClass.attribute == sentinel.attribute Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in @patch.object(SomeClass, 'attribute', sentinel.attribute) NameError: name 'patch' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: test() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in test() NameError: name 'test' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: assert SomeClass.attribute == original Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in assert SomeClass.attribute == original NameError: name 'SomeClass' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: @patch('package.module.attribute', sentinel.attribute) def test(): from package.module import attribute assert attribute is sentinel.attribute Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in @patch('package.module.attribute', sentinel.attribute) NameError: name 'patch' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: test() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in test() NameError: name 'test' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock = MagicMock(return_value = sentinel.file_handle) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = MagicMock(return_value = sentinel.file_handle) NameError: name 'MagicMock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: with patch('__builtin__.open', mock): handle = open('filename', 'r') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in with patch('__builtin__.open', mock): NameError: name 'patch' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock.assert_called_with('filename', 'r') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.assert_called_with('filename', 'r') NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: assert handle == sentinel.file_handle, "incorrect file handle returned" Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in assert handle == sentinel.file_handle, "incorrect file handle returned" NameError: name 'handle' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: @patch('package.module.ClassName.attribute', sentinel.attribute) def test(): from package.module import ClassName assert ClassName.attribute == sentinel.attribute Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in @patch('package.module.ClassName.attribute', sentinel.attribute) NameError: name 'patch' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: test() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in test() NameError: name 'test' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: class MyTest(unittest2.TestCase): @patch.object(SomeClass, 'attribute', sentinel.attribute) def test_something(self): self.assertEqual(SomeClass.attribute, sentinel.attribute) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in class MyTest(unittest2.TestCase): NameError: name 'unittest2' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: original = SomeClass.attribute Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in original = SomeClass.attribute NameError: name 'SomeClass' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: MyTest('test_something').test_something() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in MyTest('test_something').test_something() NameError: name 'MyTest' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: assert SomeClass.attribute == original Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in assert SomeClass.attribute == original NameError: name 'SomeClass' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: class MyTest(unittest2.TestCase): @patch.object(SomeClass, 'static_method') def test_something(self, mock_method): SomeClass.static_method() mock_method.assert_called_with() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in class MyTest(unittest2.TestCase): NameError: name 'unittest2' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: MyTest('test_something').test_something() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in MyTest('test_something').test_something() NameError: name 'MyTest' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: class MyTest(unittest2.TestCase): @patch('package.module.ClassName1') @patch('package.module.ClassName2') def test_something(self, MockClass2, MockClass1): self.assertIs(package.module.ClassName1, MockClass1) self.assertIs(package.module.ClassName2, MockClass2) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in class MyTest(unittest2.TestCase): NameError: name 'unittest2' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: MyTest('test_something').test_something() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in MyTest('test_something').test_something() NameError: name 'MyTest' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: with patch.dict(foo, {'newkey': 'newvalue'}, clear=True): assert foo == {'newkey': 'newvalue'} Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in with patch.dict(foo, {'newkey': 'newvalue'}, clear=True): NameError: name 'patch' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: with patch.object(ProductionClass, 'method') as mock_method: mock_method.return_value = None real = ProductionClass() real.method(1, 2, 3) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in with patch.object(ProductionClass, 'method') as mock_method: NameError: name 'patch' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock_method.assert_called_with(1, 2, 3) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock_method.assert_called_with(1, 2, 3) NameError: name 'mock_method' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock = Mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock() NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock().foo(a=2, b=3) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock().foo(a=2, b=3) NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock.return_value.foo.assert_called_with(a=2, b=3) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.return_value.foo.assert_called_with(a=2, b=3) NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: something = Something() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in something = Something() File "", line 3, in __init__ NameError: name 'BackendProvider' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock_response = Mock(spec=file) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock_response = Mock(spec=file) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock_backend = Mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock_backend = Mock() NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: config = {'get_endpoint.return_value.create_call.return_value.start_call.return_value': mock_response} Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in config = {'get_endpoint.return_value.create_call.return_value.start_call.return_value': mock_response} NameError: name 'mock_response' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock_backend.configure_mock(**config) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock_backend.configure_mock(**config) NameError: name 'mock_backend' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: something.backend = mock_backend Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in something.backend = mock_backend NameError: name 'mock_backend' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: something.method() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in something.method() NameError: name 'something' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: chained = call.get_endpoint('foobar').create_call('spam', 'eggs').start_call() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in chained = call.get_endpoint('foobar').create_call('spam', 'eggs').start_call() NameError: name 'call' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: call_list = chained.call_list() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in call_list = chained.call_list() NameError: name 'chained' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: assert mock_backend.mock_calls == call_list Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in assert mock_backend.mock_calls == call_list NameError: name 'mock_backend' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: with patch('mymodule.date') as mock_date: mock_date.today.return_value = date(2010, 10, 8) mock_date.side_effect = lambda *args, **kw: date(*args, **kw) assert mymodule.date.today() == date(2010, 10, 8) assert mymodule.date(2009, 6, 8) == date(2009, 6, 8) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in with patch('mymodule.date') as mock_date: NameError: name 'patch' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock_foo = MagicMock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock_foo = MagicMock() NameError: name 'MagicMock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock_foo.iter.return_value = iter([1, 2, 3]) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock_foo.iter.return_value = iter([1, 2, 3]) NameError: name 'mock_foo' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: list(mock_foo.iter()) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in list(mock_foo.iter()) NameError: name 'mock_foo' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: @patch('mymodule.SomeClass') class MyTest(TestCase): def test_one(self, MockSomeClass): self.assertIs(mymodule.SomeClass, MockSomeClass) def test_two(self, MockSomeClass): self.assertIs(mymodule.SomeClass, MockSomeClass) def not_a_test(self): return 'something' Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in @patch('mymodule.SomeClass') NameError: name 'patch' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: MyTest('test_one').test_one() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in MyTest('test_one').test_one() NameError: name 'MyTest' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: MyTest('test_two').test_two() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in MyTest('test_two').test_two() NameError: name 'MyTest' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: MyTest('test_two').not_a_test() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in MyTest('test_two').not_a_test() NameError: name 'MyTest' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: class MyTest(TestCase): def setUp(self): self.patcher = patch('mymodule.foo') self.mock_foo = self.patcher.start() def test_foo(self): self.assertIs(mymodule.foo, self.mock_foo) def tearDown(self): self.patcher.stop() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in class MyTest(TestCase): NameError: name 'TestCase' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: MyTest('test_foo').run() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in MyTest('test_foo').run() NameError: name 'MyTest' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: class MyTest(TestCase): def setUp(self): patcher = patch('mymodule.foo') self.addCleanup(patcher.stop) self.mock_foo = patcher.start() def test_foo(self): self.assertIs(mymodule.foo, self.mock_foo) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in class MyTest(TestCase): NameError: name 'TestCase' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: MyTest('test_foo').run() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in MyTest('test_foo').run() NameError: name 'MyTest' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: with patch.object(Foo, 'foo', autospec=True) as mock_foo: mock_foo.return_value = 'foo' foo = Foo() foo.foo() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in with patch.object(Foo, 'foo', autospec=True) as mock_foo: NameError: name 'patch' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock_foo.assert_called_once_with(foo) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock_foo.assert_called_once_with(foo) NameError: name 'mock_foo' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock = Mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock() NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock.foo_bar.return_value = None Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.foo_bar.return_value = None NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock.foo_bar('baz', spam='eggs') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.foo_bar('baz', spam='eggs') NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock.foo_bar.assert_called_with('baz', spam='eggs') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.foo_bar.assert_called_with('baz', spam='eggs') NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock.foo_bar.assert_called_once_with('baz', spam='eggs') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.foo_bar.assert_called_once_with('baz', spam='eggs') NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock.foo_bar() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.foo_bar() NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock.foo_bar.assert_called_once_with('baz', spam='eggs') Expected: Traceback (most recent call last): ... AssertionError: Expected to be called once. Called 2 times. Got: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.foo_bar.assert_called_once_with('baz', spam='eggs') NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock = Mock(return_value=None) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock(return_value=None) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock(1, 2, 3) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock(1, 2, 3) NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock(4, 5, 6) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock(4, 5, 6) NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock() NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock.call_args_list Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.call_args_list NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: expected = [call(1, 2, 3), call(4, 5, 6), call()] Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in expected = [call(1, 2, 3), call(4, 5, 6), call()] NameError: name 'call' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock.call_args_list == expected Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.call_args_list == expected NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: with patch('mymodule.frob') as mock_frob: val = set([6]) mymodule.grob(val) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in with patch('mymodule.frob') as mock_frob: NameError: name 'patch' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: val Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in val NameError: name 'val' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock_frob.assert_called_with(set([6])) Expected: Traceback (most recent call last): ... AssertionError: Expected: ((set([6]),), {}) Called with: ((set([]),), {}) Got: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock_frob.assert_called_with(set([6])) NameError: name 'mock_frob' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: with patch('mymodule.frob') as mock_frob: new_mock = copy_call_args(mock_frob) val = set([6]) mymodule.grob(val) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in with patch('mymodule.frob') as mock_frob: File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1158, in __enter__ self.target = self.getter() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1320, in getter = lambda: _importer(target) File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1014, in _importer thing = __import__(import_path) ImportError: No module named 'mymodule' ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: new_mock.assert_called_with(set([6])) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in new_mock.assert_called_with(set([6])) NameError: name 'new_mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: new_mock.call_args Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in new_mock.call_args NameError: name 'new_mock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: class CopyingMock(MagicMock): def __call__(self, *args, **kwargs): args = deepcopy(args) kwargs = deepcopy(kwargs) return super(CopyingMock, self).__call__(*args, **kwargs) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in class CopyingMock(MagicMock): NameError: name 'MagicMock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: c = CopyingMock(return_value=None) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in c = CopyingMock(return_value=None) NameError: name 'CopyingMock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: c(arg) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in c(arg) NameError: name 'c' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: c.assert_called_with(set()) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in c.assert_called_with(set()) NameError: name 'c' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: c.assert_called_with(arg) Expected: Traceback (most recent call last): ... AssertionError: Expected call: mock(set([1])) Actual call: mock(set([])) Got: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in c.assert_called_with(arg) NameError: name 'c' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: c.foo Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in c.foo NameError: name 'c' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: class MyTest(TestCase): def test_foo(self): with patch('mymodule.Foo') as mock_foo: with patch('mymodule.Bar') as mock_bar: with patch('mymodule.Spam') as mock_spam: assert mymodule.Foo is mock_foo assert mymodule.Bar is mock_bar assert mymodule.Spam is mock_spam Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in class MyTest(TestCase): NameError: name 'TestCase' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: original = mymodule.Foo Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in original = mymodule.Foo NameError: name 'mymodule' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: MyTest('test_foo').test_foo() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in MyTest('test_foo').test_foo() NameError: name 'MyTest' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: assert mymodule.Foo is original Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in assert mymodule.Foo is original NameError: name 'mymodule' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: class MyTest(TestCase): def create_patch(self, name): patcher = patch(name) thing = patcher.start() self.addCleanup(patcher.stop) return thing def test_foo(self): mock_foo = self.create_patch('mymodule.Foo') mock_bar = self.create_patch('mymodule.Bar') mock_spam = self.create_patch('mymodule.Spam') assert mymodule.Foo is mock_foo assert mymodule.Bar is mock_bar assert mymodule.Spam is mock_spam Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in class MyTest(TestCase): NameError: name 'TestCase' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: original = mymodule.Foo Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in original = mymodule.Foo NameError: name 'mymodule' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: MyTest('test_foo').run() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in MyTest('test_foo').run() NameError: name 'MyTest' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: assert mymodule.Foo is original Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in assert mymodule.Foo is original NameError: name 'mymodule' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock = MagicMock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = MagicMock() NameError: name 'MagicMock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock.__getitem__.side_effect = getitem Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.__getitem__.side_effect = getitem File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 546, in __getattr__ raise AttributeError(name) AttributeError: __getitem__ ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock.__setitem__.side_effect = setitem Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.__setitem__.side_effect = setitem File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 546, in __getattr__ raise AttributeError(name) AttributeError: __setitem__ ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mock = MagicMock(spec_set=dict) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = MagicMock(spec_set=dict) NameError: name 'MagicMock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: my_dict Expected: {'a': 1, 'c': 3, 'b': 'fish', 'd': 'eggs'} Got: {'a': 1, 'b': 'fish', 'c': 3, 'd': 'eggs'} ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: class MyMock(MagicMock): def has_been_called(self): return self.called Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in class MyMock(MagicMock): NameError: name 'MagicMock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mymock = MyMock(return_value=None) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mymock = MyMock(return_value=None) NameError: name 'MyMock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mymock Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mymock NameError: name 'mymock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mymock.has_been_called() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mymock.has_been_called() NameError: name 'mymock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mymock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mymock() NameError: name 'mymock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mymock.has_been_called() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mymock.has_been_called() NameError: name 'mymock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mymock.foo Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mymock.foo NameError: name 'mymock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mymock.foo.has_been_called() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mymock.foo.has_been_called() NameError: name 'mymock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mymock.foo() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mymock.foo() NameError: name 'mymock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mymock.foo.has_been_called() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mymock.foo.has_been_called() NameError: name 'mymock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: class Subclass(MagicMock): def _get_child_mock(self, **kwargs): return MagicMock(**kwargs) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in class Subclass(MagicMock): NameError: name 'MagicMock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mymock = Subclass() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mymock = Subclass() NameError: name 'Subclass' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: mymock.foo Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mymock.foo NameError: name 'mymock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: assert isinstance(mymock, Subclass) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in assert isinstance(mymock, Subclass) NameError: name 'mymock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: assert not isinstance(mymock.foo, Subclass) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in assert not isinstance(mymock.foo, Subclass) NameError: name 'mymock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: assert not isinstance(mymock(), Subclass) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in assert not isinstance(mymock(), Subclass) NameError: name 'mymock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: assert 'fooble' not in sys.modules Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in assert 'fooble' not in sys.modules NameError: name 'sys' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: expected_calls = [call.foo.something(), call.bar.other.thing()] Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in expected_calls = [call.foo.something(), call.bar.other.thing()] NameError: name 'call' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: manager.mock_calls == expected_calls Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in manager.mock_calls == expected_calls NameError: name 'expected_calls' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: manager = MagicMock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in manager = MagicMock() NameError: name 'MagicMock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: with patch('mymodule.Class1') as MockClass1: with patch('mymodule.Class2') as MockClass2: manager.attach_mock(MockClass1, 'MockClass1') manager.attach_mock(MockClass2, 'MockClass2') MockClass1().foo() MockClass2().bar() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in with patch('mymodule.Class1') as MockClass1: File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1158, in __enter__ self.target = self.getter() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1320, in getter = lambda: _importer(target) File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1014, in _importer thing = __import__(import_path) ImportError: No module named 'mymodule' ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: manager.mock_calls Expected: [call.MockClass1(), call.MockClass1().foo(), call.MockClass2(), call.MockClass2().bar()] Got: [call.foo.something(), call.bar.other.thing()] ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: m = MagicMock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in m = MagicMock() NameError: name 'MagicMock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: m().foo().bar().baz() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in m().foo().bar().baz() NameError: name 'm' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: m.one().two().three() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in m.one().two().three() NameError: name 'm' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: calls = call.one().two().three().call_list() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in calls = call.one().two().three().call_list() NameError: name 'call' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: m.assert_has_calls(calls) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in m.assert_has_calls(calls) NameError: name 'm' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: m = MagicMock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in m = MagicMock() NameError: name 'MagicMock' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: m(1), m.two(2, 3), m.seven(7), m.fifty('50') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in m(1), m.two(2, 3), m.seven(7), m.fifty('50') NameError: name 'm' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: calls = [call.fifty('50'), call(1), call.seven(7)] Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in calls = [call.fifty('50'), call(1), call.seven(7)] NameError: name 'call' is not defined ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: m.assert_has_calls(calls, any_order=True) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in m.assert_has_calls(calls, any_order=True) NameError: name 'm' is not defined ********************************************************************** 1 items had failures: 167 of 238 in default 238 tests in 1 items. 71 passed and 167 failed. ***Test Failed*** 167 failures. Document: howto/functional -------------------------- ********************************************************************** File "howto/functional.rst", line ?, in default Failed example: functools.reduce(operator.add, [1,2,3,4], 0) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in functools.reduce(operator.add, [1,2,3,4], 0) NameError: name 'operator' is not defined ********************************************************************** 1 items had failures: 1 of 43 in default 43 tests in 1 items. 42 passed and 1 failed. ***Test Failed*** 1 failures. Document: library/nntplib ------------------------- ********************************************************************** File "library/nntplib.rst", line ?, in default Failed example: with NNTP('news.gmane.org') as n: n.group('gmane.comp.python.committers') Expected: ('211 1755 1 1755 gmane.comp.python.committers', 1755, 1, 1755, 'gmane.comp.python.committers') Got: ('211 2435 1 2435 gmane.comp.python.committers', 2435, 1, 2435, 'gmane.comp.python.committers') ********************************************************************** File "library/nntplib.rst", line ?, in default Failed example: len(groups) Expected: 85 Got: 132 ********************************************************************** File "library/nntplib.rst", line ?, in default Failed example: groups[0] Expected: GroupInfo(group='gmane.network.tor.devel', last='4', first='1', flag='m') Got: GroupInfo(group='gwene.org.mathblogging', last='411', first='1', flag='m') ********************************************************************** File "library/nntplib.rst", line ?, in default Failed example: len(descs) Expected: 295 Got: 350 ********************************************************************** File "library/nntplib.rst", line ?, in default Failed example: descs.popitem() Expected: ('gmane.comp.python.bio.general', 'BioPython discussion list (Moderated)') Got: ('gmane.comp.python.org.au.melbourne', 'Melbourne Python Users Group discussion forum () (Moderated)') ********************************************************************** 1 items had failures: 5 of 21 in default 21 tests in 1 items. 16 passed and 5 failed. ***Test Failed*** 5 failures. Document: library/getopt ------------------------ 1 items passed all tests: 12 tests in default 12 tests in 1 items. 12 passed and 0 failed. Test passed. Document: library/decimal ------------------------- 2 items passed all tests: 66 tests in default 42 tests in newcontext 108 tests in 2 items. 108 passed and 0 failed. Test passed. Document: faq/programming ------------------------- ********************************************************************** File "faq/programming.rst", line ?, in default Failed example: A[0][0] = 5 Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in A[0][0] = 5 NameError: name 'A' is not defined ********************************************************************** File "faq/programming.rst", line ?, in default Failed example: A Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in A NameError: name 'A' is not defined ********************************************************************** File "faq/programming.rst", line ?, in default Failed example: import cls Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in import cls ImportError: No module named 'cls' ********************************************************************** File "faq/programming.rst", line ?, in default Failed example: c = cls.C() # Create an instance of C Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in c = cls.C() # Create an instance of C NameError: name 'cls' is not defined ********************************************************************** File "faq/programming.rst", line ?, in default Failed example: imp.reload(cls) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in imp.reload(cls) NameError: name 'cls' is not defined ********************************************************************** File "faq/programming.rst", line ?, in default Failed example: isinstance(c, cls.C) # isinstance is false?!? Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in isinstance(c, cls.C) # isinstance is false?!? NameError: name 'c' is not defined ********************************************************************** File "faq/programming.rst", line ?, in default Failed example: hex(id(c.__class__)) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in hex(id(c.__class__)) NameError: name 'c' is not defined ********************************************************************** File "faq/programming.rst", line ?, in default Failed example: hex(id(cls.C)) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in hex(id(cls.C)) NameError: name 'cls' is not defined ********************************************************************** 1 items had failures: 8 of 21 in default 21 tests in 1 items. 13 passed and 8 failed. ***Test Failed*** 8 failures. Document: library/unittest.mock ------------------------------- ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: thing = ProductionClass() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in thing = ProductionClass() NameError: name 'ProductionClass' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: thing.method = MagicMock(return_value=3) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in thing.method = MagicMock(return_value=3) NameError: name 'thing' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: thing.method(3, 4, 5, key='value') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in thing.method(3, 4, 5, key='value') NameError: name 'thing' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: thing.method.assert_called_with(3, 4, 5, key='value') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in thing.method.assert_called_with(3, 4, 5, key='value') NameError: name 'thing' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock(side_effect=KeyError('foo')) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock(side_effect=KeyError('foo')) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock() Expected: Traceback (most recent call last): ... KeyError: 'foo' Got: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock() NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.side_effect = side_effect Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.side_effect = side_effect NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock('a'), mock('b'), mock('c') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock('a'), mock('b'), mock('c') NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.side_effect = [5, 4, 3, 2, 1] Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.side_effect = [5, 4, 3, 2, 1] NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock(), mock(), mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock(), mock(), mock() NameError: name 'mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: test() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in test() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1105, in patched arg = patching.__enter__() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1158, in __enter__ self.target = self.getter() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1320, in getter = lambda: _importer(target) File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1014, in _importer thing = __import__(import_path) ImportError: No module named 'module' ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: with patch.object(ProductionClass, 'method', return_value=None) as mock_method: thing = ProductionClass() thing.method(1, 2, 3) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in with patch.object(ProductionClass, 'method', return_value=None) as mock_method: NameError: name 'ProductionClass' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock_method.assert_called_once_with(1, 2, 3) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock_method.assert_called_once_with(1, 2, 3) NameError: name 'mock_method' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock() NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.__str__ = Mock(return_value='wheeeeee') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.__str__ = Mock(return_value='wheeeeee') NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: str(mock) Expected: 'wheeeeee' Got: 'foobarbaz' ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock() NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.method(1, 2, 3, test='wow') Expected: Got: ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock(return_value=None) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock(return_value=None) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock('foo', bar='baz') Expected nothing Got: ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock('foo', bar='baz') Expected nothing Got: ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock(return_value=None) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock(return_value=None) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock(1, 2, arg='thing') Expected nothing Got: ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock('some', 'thing', 'else') Expected nothing Got: ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock(return_value=None) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock(return_value=None) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock(1) Expected nothing Got: ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock(2) Expected nothing Got: ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock(3) Expected nothing Got: ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock(4) Expected nothing Got: ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: calls = [call(2), call(3)] Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in calls = [call(2), call(3)] NameError: name 'call' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.assert_has_calls(calls) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.assert_has_calls(calls) NameError: name 'calls' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: calls = [call(4), call(2), call(3)] Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in calls = [call(4), call(2), call(3)] NameError: name 'call' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.assert_has_calls(calls, any_order=True) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.assert_has_calls(calls, any_order=True) NameError: name 'calls' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock(return_value=None) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock(return_value=None) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock('hello') Expected nothing Got: ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock() NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock(some_attribute='eggs', **attrs) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock(some_attribute='eggs', **attrs) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.some_attribute Expected: 'eggs' Got: ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock(return_value=None) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock(return_value=None) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock() Expected nothing Got: ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock(return_value=None) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock(return_value=None) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.call_count Expected: 0 Got: 1 ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock() Expected nothing Got: ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock() Expected nothing Got: ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.call_count Expected: 2 Got: 3 ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock() NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock() NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.return_value.attribute = sentinel.Attribute Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.return_value.attribute = sentinel.Attribute NameError: name 'sentinel' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.return_value() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.return_value() TypeError: 'str' object is not callable ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.return_value.assert_called_with() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.return_value.assert_called_with() AttributeError: 'str' object has no attribute 'assert_called_with' ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock(return_value=3) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock(return_value=3) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.return_value Expected: 3 Got: 'fish' ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock() Expected: 3 Got: 'fish' ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock() NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock() NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock(return_value=3) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock(return_value=3) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 872, in __call__ return _mock_self._mock_call(*args, **kwargs) File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 936, in _mock_call ret_val = effect(*args, **kwargs) File "", line 2, in side_effect return DEFAULT NameError: name 'DEFAULT' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock(side_effect=side_effect) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock(side_effect=side_effect) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock(3) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock(3) File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 872, in __call__ return _mock_self._mock_call(*args, **kwargs) File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 936, in _mock_call ret_val = effect(*args, **kwargs) File "", line 2, in side_effect NameError: name 'DEFAULT' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock(-8) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock(-8) File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 872, in __call__ return _mock_self._mock_call(*args, **kwargs) File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 936, in _mock_call ret_val = effect(*args, **kwargs) File "", line 2, in side_effect NameError: name 'DEFAULT' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: m = Mock(side_effect=KeyError, return_value=3) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in m = Mock(side_effect=KeyError, return_value=3) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: m() Expected: Traceback (most recent call last): ... KeyError Got: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in m() NameError: name 'm' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: m.side_effect = None Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in m.side_effect = None NameError: name 'm' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: m() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in m() NameError: name 'm' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock(return_value=None) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock(return_value=None) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: print mock.call_args Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "/home/beni/pycon/cpython/Doc/toolsenv/lib/python3.4/site-packages/sphinx/ext/doctest.py", line 349, in compile return compile(code, name, self.type, flags, dont_inherit) File "", line 1 print mock.call_args ^ SyntaxError: invalid syntax ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 872, in __call__ return _mock_self._mock_call(*args, **kwargs) File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 936, in _mock_call ret_val = effect(*args, **kwargs) File "", line 2, in side_effect NameError: name 'DEFAULT' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock(3, 4) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock(3, 4) File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 872, in __call__ return _mock_self._mock_call(*args, **kwargs) File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 936, in _mock_call ret_val = effect(*args, **kwargs) File "", line 2, in side_effect NameError: name 'DEFAULT' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock(3, 4, 5, key='fish', next='w00t!') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock(3, 4, 5, key='fish', next='w00t!') File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 872, in __call__ return _mock_self._mock_call(*args, **kwargs) File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 936, in _mock_call ret_val = effect(*args, **kwargs) File "", line 2, in side_effect NameError: name 'DEFAULT' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.call_args Expected: call(3, 4, 5, key='fish', next='w00t!') Got: call(3, 4, 5, next='w00t!', key='fish') ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock(return_value=None) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock(return_value=None) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 872, in __call__ return _mock_self._mock_call(*args, **kwargs) File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 936, in _mock_call ret_val = effect(*args, **kwargs) File "", line 2, in side_effect NameError: name 'DEFAULT' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock(3, 4) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock(3, 4) File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 872, in __call__ return _mock_self._mock_call(*args, **kwargs) File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 936, in _mock_call ret_val = effect(*args, **kwargs) File "", line 2, in side_effect NameError: name 'DEFAULT' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock(key='fish', next='w00t!') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock(key='fish', next='w00t!') File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 872, in __call__ return _mock_self._mock_call(*args, **kwargs) File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 936, in _mock_call ret_val = effect(*args, **kwargs) File "", line 2, in side_effect NameError: name 'DEFAULT' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.call_args_list Expected: [call(), call(3, 4), call(key='fish', next='w00t!')] Got: [call(), call(), call(), call(), call(), call(), call(), call(), call(), call(), call(3), call(-8), call(), call(3, 4), call(3, 4, 5, next='w00t!', key='fish'), call(), call(3, 4), call(next='w00t!', key='fish')] ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.call_args_list == expected Expected: True Got: False ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock() NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.method() Expected: Got: 3 ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.property.method.attribute() Expected: Got: ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.method_calls Expected: [call.method(), call.property.method.attribute()] Got: [call.method(), call.other(), call.method(), call.other(), call.method(), call.property.method.attribute()] ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: expected = [call(1, 2, 3), call.first(a=3), call.second(), call.__int__(), call()(1)] Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in expected = [call(1, 2, 3), call.first(a=3), call.second(), NameError: name 'call' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.mock_calls == expected Expected: True Got: False ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock(spec=3) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock(spec=3) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: isinstance(mock, int) Expected: True Got: False ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock() NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock(spec=SomeClass) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock(spec=SomeClass) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: isinstance(mock, SomeClass) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in isinstance(mock, SomeClass) NameError: name 'SomeClass' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock(spec_set=SomeClass()) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock(spec_set=SomeClass()) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: isinstance(mock, SomeClass) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in isinstance(mock, SomeClass) NameError: name 'SomeClass' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock(some_attribute='eggs', **attrs) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock(some_attribute='eggs', **attrs) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.some_attribute Expected: 'eggs' Got: ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.method() Expected: 3 Got: ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.other() Expected: Traceback (most recent call last): ... KeyError Got: ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: with patch('__main__.Foo.foo', new_callable=PropertyMock) as mock_foo: mock_foo.return_value = 'mockity-mock' this_foo = Foo() print this_foo.foo this_foo.foo = 6 Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "/home/beni/pycon/cpython/Doc/toolsenv/lib/python3.4/site-packages/sphinx/ext/doctest.py", line 349, in compile return compile(code, name, self.type, flags, dont_inherit) File "", line 4 print this_foo.foo ^ SyntaxError: invalid syntax ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock_foo.mock_calls Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock_foo.mock_calls NameError: name 'mock_foo' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: m() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in m() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 872, in __call__ return _mock_self._mock_call(*args, **kwargs) File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 936, in _mock_call ret_val = effect(*args, **kwargs) File "", line 2, in side_effect return DEFAULT NameError: name 'DEFAULT' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: with patch('__main__.thing1', return_value=None) as child1: with patch('__main__.thing2', return_value=None) as child2: parent.attach_mock(child1, 'child1') parent.attach_mock(child2, 'child2') child1('one') child2('two') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in with patch('__main__.thing1', return_value=None) as child1: File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1174, in __enter__ original, local = self.get_original() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1148, in get_original "%s does not have the attribute %r" % (target, name) AttributeError: does not have the attribute 'thing1' ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: parent.mock_calls Expected: [call.child1('one'), call.child2('two')] Got: [] ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: function(None) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in function(None) File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1105, in patched arg = patching.__enter__() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1174, in __enter__ original, local = self.get_original() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1148, in get_original "%s does not have the attribute %r" % (target, name) AttributeError: does not have the attribute 'SomeClass' ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: with patch('__main__.Class') as MockClass: instance = MockClass.return_value instance.method.return_value = 'foo' assert Class() is instance assert Class().method() == 'foo' Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in with patch('__main__.Class') as MockClass: File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1174, in __enter__ original, local = self.get_original() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1148, in get_original "%s does not have the attribute %r" % (target, name) AttributeError: does not have the attribute 'Class' ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: MockClass = patcher.start() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in MockClass = patcher.start() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1302, in start result = self.__enter__() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1174, in __enter__ original, local = self.get_original() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1148, in get_original "%s does not have the attribute %r" % (target, name) AttributeError: does not have the attribute 'Class' ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: instance = MockClass() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in instance = MockClass() NameError: name 'MockClass' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: assert isinstance(instance, Original) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in assert isinstance(instance, Original) NameError: name 'instance' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: patcher.stop() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in patcher.stop() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1310, in stop return self.__exit__() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1282, in __exit__ raise RuntimeError('stop called on unstarted patcher') RuntimeError: stop called on unstarted patcher ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: with patch('__main__.thing', new_callable=NonCallableMock) as mock_thing: assert thing is mock_thing thing() Expected: Traceback (most recent call last): ... TypeError: 'NonCallableMock' object is not callable Got: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in with patch('__main__.thing', new_callable=NonCallableMock) as mock_thing: NameError: name 'NonCallableMock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: from StringIO import StringIO Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in from StringIO import StringIO ImportError: No module named 'StringIO' ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: def foo(): print 'Something' Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "/home/beni/pycon/cpython/Doc/toolsenv/lib/python3.4/site-packages/sphinx/ext/doctest.py", line 349, in compile return compile(code, name, self.type, flags, dont_inherit) File "", line 2 print 'Something' ^ SyntaxError: invalid syntax ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: @patch('sys.stdout', new_callable=StringIO) def test(mock_stdout): foo() assert mock_stdout.getvalue() == 'Something\n' Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in @patch('sys.stdout', new_callable=StringIO) NameError: name 'StringIO' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: test() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in test() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1105, in patched arg = patching.__enter__() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1158, in __enter__ self.target = self.getter() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1320, in getter = lambda: _importer(target) File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1014, in _importer thing = __import__(import_path) ImportError: No module named 'module' ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock_thing = patcher.start() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock_thing = patcher.start() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1302, in start result = self.__enter__() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1174, in __enter__ original, local = self.get_original() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1148, in get_original "%s does not have the attribute %r" % (target, name) AttributeError: does not have the attribute 'thing' ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock_thing.first Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock_thing.first NameError: name 'mock_thing' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock_thing.second Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock_thing.second NameError: name 'mock_thing' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock_thing = patcher.start() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock_thing = patcher.start() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1302, in start result = self.__enter__() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1174, in __enter__ original, local = self.get_original() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1148, in get_original "%s does not have the attribute %r" % (target, name) AttributeError: does not have the attribute 'thing' ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock_thing.method() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock_thing.method() NameError: name 'mock_thing' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock_thing.other() Expected: Traceback (most recent call last): ... KeyError Got: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock_thing.other() NameError: name 'mock_thing' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: @patch.object(SomeClass, 'class_method') def test(mock_method): SomeClass.class_method(3) mock_method.assert_called_with(3) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in @patch.object(SomeClass, 'class_method') NameError: name 'SomeClass' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: test() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in test() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1105, in patched arg = patching.__enter__() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1158, in __enter__ self.target = self.getter() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1320, in getter = lambda: _importer(target) File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1014, in _importer thing = __import__(import_path) ImportError: No module named 'module' ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: with patch.dict('os.environ', {'newkey': 'newvalue'}): print os.environ['newkey'] Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "/home/beni/pycon/cpython/Doc/toolsenv/lib/python3.4/site-packages/sphinx/ext/doctest.py", line 349, in compile return compile(code, name, self.type, flags, dont_inherit) File "", line 2 print os.environ['newkey'] ^ SyntaxError: invalid syntax ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: @patch.multiple('__main__', thing=DEFAULT, other=DEFAULT) def test_function(thing, other): assert isinstance(thing, MagicMock) assert isinstance(other, MagicMock) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in @patch.multiple('__main__', thing=DEFAULT, other=DEFAULT) NameError: name 'DEFAULT' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: test_function() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in test_function() NameError: name 'test_function' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: @patch('sys.exit') @patch.multiple('__main__', thing=DEFAULT, other=DEFAULT) def test_function(mock_exit, other, thing): assert 'other' in repr(other) assert 'thing' in repr(thing) assert 'exit' in repr(mock_exit) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 2, in @patch.multiple('__main__', thing=DEFAULT, other=DEFAULT) NameError: name 'DEFAULT' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: test_function() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in test_function() NameError: name 'test_function' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: with patch.multiple('__main__', thing=DEFAULT, other=DEFAULT) as values: assert 'other' in repr(values['other']) assert 'thing' in repr(values['thing']) assert values['thing'] is thing assert values['other'] is other Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in with patch.multiple('__main__', thing=DEFAULT, other=DEFAULT) as values: NameError: name 'DEFAULT' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: from package import module Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in from package import module ImportError: No module named 'package' ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: original = module.ClassName Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in original = module.ClassName NameError: name 'module' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: new_mock = patcher.start() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in new_mock = patcher.start() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1302, in start result = self.__enter__() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1158, in __enter__ self.target = self.getter() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1320, in getter = lambda: _importer(target) File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1014, in _importer thing = __import__(import_path) ImportError: No module named 'package' ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: assert module.ClassName is not original Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in assert module.ClassName is not original NameError: name 'module' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: assert module.ClassName is new_mock Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in assert module.ClassName is new_mock NameError: name 'module' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: patcher.stop() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in patcher.stop() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1310, in stop return self.__exit__() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1282, in __exit__ raise RuntimeError('stop called on unstarted patcher') RuntimeError: stop called on unstarted patcher ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: assert module.ClassName is original Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in assert module.ClassName is original NameError: name 'module' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: assert module.ClassName is not new_mock Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in assert module.ClassName is not new_mock NameError: name 'module' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: class MyTest(TestCase): def setUp(self): self.patcher1 = patch('package.module.Class1') self.patcher2 = patch('package.module.Class2') self.MockClass1 = self.patcher1.start() self.MockClass2 = self.patcher2.start() def tearDown(self): self.patcher1.stop() self.patcher2.stop() def test_something(self): assert package.module.Class1 is self.MockClass1 assert package.module.Class2 is self.MockClass2 Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in class MyTest(TestCase): NameError: name 'TestCase' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: MyTest('test_something').run() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in MyTest('test_something').run() NameError: name 'MyTest' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: class MyTest(TestCase): def setUp(self): patcher = patch('package.module.Class') self.MockClass = patcher.start() self.addCleanup(patcher.stop) def test_something(self): assert package.module.Class is self.MockClass Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in class MyTest(TestCase): NameError: name 'TestCase' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: @patch('__main__.value', 'not three') class Thing: def foo_one(self): print value def foo_two(self): print value Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "/home/beni/pycon/cpython/Doc/toolsenv/lib/python3.4/site-packages/sphinx/ext/doctest.py", line 349, in compile return compile(code, name, self.type, flags, dont_inherit) File "", line 4 print value ^ SyntaxError: invalid syntax ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: Thing().foo_one() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in Thing().foo_one() NameError: name 'Thing' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: Thing().foo_two() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in Thing().foo_two() NameError: name 'Thing' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: @patch.object(SomeClass, 'class_method') @patch.object(SomeClass, 'static_method') def test(mock1, mock2): assert SomeClass.static_method is mock1 assert SomeClass.class_method is mock2 SomeClass.static_method('foo') SomeClass.class_method('bar') return mock1, mock2 Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in @patch.object(SomeClass, 'class_method') NameError: name 'SomeClass' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock1, mock2 = test() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock1, mock2 = test() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1105, in patched arg = patching.__enter__() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1158, in __enter__ self.target = self.getter() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1320, in getter = lambda: _importer(target) File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1014, in _importer thing = __import__(import_path) ImportError: No module named 'module' ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock1.assert_called_once_with('foo') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock1.assert_called_once_with('foo') NameError: name 'mock1' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock2.assert_called_once_with('bar') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock2.assert_called_once_with('bar') NameError: name 'mock2' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock() NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock() NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.__str__ = Mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.__str__ = Mock() NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock() NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.__iter__ = Mock(return_value=iter([])) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.__iter__ = Mock(return_value=iter([])) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock() NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.__enter__ = Mock(return_value='foo') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.__enter__ = Mock(return_value='foo') NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.__exit__ = Mock(return_value=False) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.__exit__ = Mock(return_value=False) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: with mock as m: assert m == 'foo' Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 2, in assert m == 'foo' AssertionError ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.__exit__.assert_called_with(None, None, None) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.__exit__.assert_called_with(None, None, None) File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 747, in assert_called_with raise AssertionError(_error_message()) from cause AssertionError: Expected call: __exit__(None, None, None) Actual call: __exit__(, AssertionError(), ) ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: real = ProductionClass() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in real = ProductionClass() NameError: name 'ProductionClass' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: real.method = Mock(name="method") Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in real.method = Mock(name="method") NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: real.method.return_value = sentinel.some_object Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in real.method.return_value = sentinel.some_object NameError: name 'sentinel' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: result = real.method() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in result = real.method() NameError: name 'real' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: assert result is sentinel.some_object Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in assert result is sentinel.some_object NameError: name 'sentinel' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: sentinel.some_object Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in sentinel.some_object NameError: name 'sentinel' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: m.call_args_list == [call(1, 2, a='foo', b='bar'), call()] Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in m.call_args_list == [call(1, 2, a='foo', b='bar'), call()] NameError: name 'call' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: kall = call(1).method(arg='foo').other('bar')(2.0) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in kall = call(1).method(arg='foo').other('bar')(2.0) NameError: name 'call' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: kall.call_list() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in kall.call_list() NameError: name 'kall' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: m.mock_calls == kall.call_list() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in m.mock_calls == kall.call_list() NameError: name 'kall' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: kwargs Expected: {'arg2': 'two', 'arg': 'one'} Got: {'arg': 'one', 'arg2': 'two'} ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: kwargs Expected: {'arg2': 'three', 'arg': 'two'} Got: {'arg': 'two', 'arg2': 'three'} ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock(return_value=None) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock(return_value=None) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock('foo', bar=object()) Expected nothing Got: ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.assert_called_once_with('foo', bar=ANY) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.assert_called_once_with('foo', bar=ANY) NameError: name 'ANY' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: m.mock_calls == [call(1), call(1, 2), ANY] Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in m.mock_calls == [call(1), call(1, 2), ANY] NameError: name 'call' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: dir(Mock()) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in dir(Mock()) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: dir(Mock(spec=request)) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in dir(Mock(spec=request)) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: dir(mock.Mock()) Expected: ['_NonCallableMock__get_return_value', '_NonCallableMock__get_side_effect', '_NonCallableMock__return_value_doc', '_NonCallableMock__set_return_value', '_NonCallableMock__set_side_effect', '__call__', '__class__', ... Got: ['_NonCallableMock__get_return_value', '_NonCallableMock__get_side_effect', '_NonCallableMock__return_value_doc', '_NonCallableMock__set_return_value', '_NonCallableMock__set_side_effect', '__call__', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattr__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_call_matcher', '_format_mock_call_signature', '_format_mock_failure_message', '_get_child_mock', '_mock_add_spec', '_mock_call', '_mock_call_args', '_mock_call_args_list', '_mock_call_count', '_mock_called', '_mock_check_sig', '_mock_children', '_mock_delegate', '_mock_methods', '_mock_mock_calls', '_mock_name', '_mock_new_name', '_mock_new_parent', '_mock_parent', '_mock_return_value', '_mock_side_effect', '_mock_wraps', '_spec_class', '_spec_set', '_spec_signature', 'assert_any_call', 'assert_called_once_with', 'assert_called_with', 'assert_has_calls', 'attach_mock', 'call_args', 'call_args_list', 'call_count', 'called', 'configure_mock', 'method_calls', 'mock_add_spec', 'mock_calls', 'reset_mock', 'return_value', 'side_effect'] ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: m = mock_open() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in m = mock_open() NameError: name 'mock_open' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: with patch('__main__.open', m, create=True): with open('foo', 'w') as h: h.write('some stuff') Expected nothing Got: 10 ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: m.mock_calls Expected: [call('foo', 'w'), call().__enter__(), call().write('some stuff'), call().__exit__(None, None, None)] Got: [call(1), call(1, 2), call()] ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: m.assert_called_once_with('foo', 'w') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in m.assert_called_once_with('foo', 'w') File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 757, in assert_called_once_with raise AssertionError(msg) AssertionError: Expected 'mock' to be called once. Called 3 times. ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: handle.write.assert_called_once_with('some stuff') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in handle.write.assert_called_once_with('some stuff') AttributeError: 'NoneType' object has no attribute 'write' ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: with patch('__main__.open', mock_open(read_data='bibble'), create=True) as m: with open('foo') as h: result = h.read() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in with patch('__main__.open', mock_open(read_data='bibble'), create=True) as m: NameError: name 'mock_open' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: m.assert_called_once_with('foo') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in m.assert_called_once_with('foo') File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 757, in assert_called_once_with raise AssertionError(msg) AssertionError: Expected 'mock' to be called once. Called 4 times. ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: assert result == 'bibble' Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in assert result == 'bibble' AssertionError ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock(name='Thing', return_value=None) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock(name='Thing', return_value=None) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock(1, 2, 3) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock(1, 2, 3) TypeError: 'module' object is not callable ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.assert_called_once_with(1, 2, 3) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.assert_called_once_with(1, 2, 3) AttributeError: 'module' object has no attribute 'assert_called_once_with' ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock(1, 2, 3) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock(1, 2, 3) TypeError: 'module' object is not callable ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.assert_called_once_with(1, 2, 3) Expected: Traceback (most recent call last): ... AssertionError: Expected 'mock' to be called once. Called 2 times. Got: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.assert_called_once_with(1, 2, 3) AttributeError: 'module' object has no attribute 'assert_called_once_with' ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = Mock(spec=request.Request) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = Mock(spec=request.Request) NameError: name 'Mock' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock_request = patcher.start() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock_request = patcher.start() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1302, in start result = self.__enter__() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1174, in __enter__ original, local = self.get_original() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1148, in get_original "%s does not have the attribute %r" % (target, name) AttributeError: does not have the attribute 'request' ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: request is mock_request Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in request is mock_request NameError: name 'mock_request' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock_request.Request Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock_request.Request NameError: name 'mock_request' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: req = request.Request('foo') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in req = request.Request('foo') File "/home/beni/pycon/cpython/Lib/urllib/request.py", line 281, in __init__ self._parse() File "/home/beni/pycon/cpython/Lib/urllib/request.py", line 304, in _parse raise ValueError("unknown url type: %s" % self.full_url) ValueError: unknown url type: foo ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: req Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in req NameError: name 'req' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: req.add_header('spam', 'eggs') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in req.add_header('spam', 'eggs') NameError: name 'req' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: req.add_header.assret_called_with Expected: Traceback (most recent call last): ... AttributeError: Mock object has no attribute 'assret_called_with' Got: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in req.add_header.assret_called_with NameError: name 'req' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: req.add_header.assert_called_with('spam', 'eggs') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in req.add_header.assert_called_with('spam', 'eggs') NameError: name 'req' is not defined ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: with patch('__main__.Something', autospec=True): thing = Something() thing.a = 33 Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in with patch('__main__.Something', autospec=True): File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1174, in __enter__ original, local = self.get_original() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1148, in get_original "%s does not have the attribute %r" % (target, name) AttributeError: does not have the attribute 'Something' ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock = p.start() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock = p.start() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1302, in start result = self.__enter__() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1174, in __enter__ original, local = self.get_original() File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 1148, in get_original "%s does not have the attribute %r" % (target, name) AttributeError: does not have the attribute 'Something' ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.a Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mock.a File "/home/beni/pycon/cpython/Lib/unittest/mock.py", line 544, in __getattr__ raise AttributeError("Mock object has no attribute %r" % name) AttributeError: Mock object has no attribute 'a' ********************************************************************** 1 items had failures: 195 of 409 in default 409 tests in 1 items. 214 passed and 195 failed. ***Test Failed*** 195 failures. Document: tutorial/floatingpoint -------------------------------- ********************************************************************** File "tutorial/floatingpoint.rst", line ?, in default Failed example: math.fsum([0.1] * 10) == 1.0 Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in math.fsum([0.1] * 10) == 1.0 NameError: name 'math' is not defined ********************************************************************** 1 items had failures: 1 of 2 in default 2 tests in 1 items. 1 passed and 1 failed. ***Test Failed*** 1 failures. Document: library/itertools --------------------------- 1 items passed all tests: 1 tests in default 1 tests in 1 items. 1 passed and 0 failed. Test passed. Document: library/collections ----------------------------- ********************************************************************** File "library/collections.rst", line ?, in default Failed example: Counter('abracadabra').most_common(3) Expected: [('a', 5), ('r', 2), ('b', 2)] Got: [('a', 5), ('b', 2), ('r', 2)] ********************************************************************** File "library/collections.rst", line ?, in default Failed example: list(d.items()) Expected: [('i', 4), ('p', 2), ('s', 4), ('m', 1)] Got: [('p', 2), ('i', 4), ('s', 4), ('m', 1)] ********************************************************************** File "library/collections.rst", line ?, in default Failed example: class Point(namedtuple('Point', 'x y')): Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "/home/beni/pycon/cpython/Doc/toolsenv/lib/python3.4/site-packages/sphinx/ext/doctest.py", line 349, in compile return compile(code, name, self.type, flags, dont_inherit) File "", line 1 class Point(namedtuple('Point', 'x y')): ^ SyntaxError: unexpected EOF while parsing ********************************************************************** File "library/collections.rst", line ?, in default Failed example: for p in Point(3, 4), Point(14, 5/7): Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "/home/beni/pycon/cpython/Doc/toolsenv/lib/python3.4/site-packages/sphinx/ext/doctest.py", line 349, in compile return compile(code, name, self.type, flags, dont_inherit) File "", line 1 for p in Point(3, 4), Point(14, 5/7): ^ SyntaxError: unexpected EOF while parsing ********************************************************************** File "library/collections.rst", line ?, in default Failed example: class Status: Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "/home/beni/pycon/cpython/Doc/toolsenv/lib/python3.4/site-packages/sphinx/ext/doctest.py", line 349, in compile return compile(code, name, self.type, flags, dont_inherit) File "", line 1 class Status: ^ SyntaxError: unexpected EOF while parsing ********************************************************************** 1 items had failures: 5 of 93 in default 93 tests in 1 items. 88 passed and 5 failed. ***Test Failed*** 5 failures. Document: library/ipaddress --------------------------- ********************************************************************** File "library/ipaddress.rst", line 73, in default Failed example: ipaddress.ip_network('192.168.0.0/28') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in ipaddress.ip_network('192.168.0.0/28') NameError: name 'ipaddress' is not defined ********************************************************************** File "library/ipaddress.rst", line 125, in default Failed example: ipaddress.IPv4Address('192.168.0.1') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in ipaddress.IPv4Address('192.168.0.1') NameError: name 'ipaddress' is not defined ********************************************************************** File "library/ipaddress.rst", line 127, in default Failed example: ipaddress.IPv4Address(3232235521) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in ipaddress.IPv4Address(3232235521) NameError: name 'ipaddress' is not defined ********************************************************************** File "library/ipaddress.rst", line 129, in default Failed example: ipaddress.IPv4Address(b'\xC0\xA8\x00\x01') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in ipaddress.IPv4Address(b'\xC0\xA8\x00\x01') NameError: name 'ipaddress' is not defined ********************************************************************** File "library/ipaddress.rst", line 205, in default Failed example: ipaddress.IPv6Address('2001:db8::1000') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in ipaddress.IPv6Address('2001:db8::1000') NameError: name 'ipaddress' is not defined ********************************************************************** File "library/ipaddress.rst", line ?, in default Failed example: list(ip_network('192.0.2.0/29').hosts()) #doctest: +NORMALIZE_WHITESPACE Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in list(ip_network('192.0.2.0/29').hosts()) #doctest: +NORMALIZE_WHITESPACE NameError: name 'ip_network' is not defined ********************************************************************** File "library/ipaddress.rst", line ?, in default Failed example: n1 = ip_network('192.0.2.0/28') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in n1 = ip_network('192.0.2.0/28') NameError: name 'ip_network' is not defined ********************************************************************** File "library/ipaddress.rst", line ?, in default Failed example: n2 = ip_network('192.0.2.1/32') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in n2 = ip_network('192.0.2.1/32') NameError: name 'ip_network' is not defined ********************************************************************** File "library/ipaddress.rst", line ?, in default Failed example: list(n1.address_exclude(n2)) #doctest: +NORMALIZE_WHITESPACE Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in list(n1.address_exclude(n2)) #doctest: +NORMALIZE_WHITESPACE NameError: name 'n1' is not defined ********************************************************************** File "library/ipaddress.rst", line ?, in default Failed example: list(ip_network('192.0.2.0/24').subnets()) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in list(ip_network('192.0.2.0/24').subnets()) NameError: name 'ip_network' is not defined ********************************************************************** File "library/ipaddress.rst", line ?, in default Failed example: list(ip_network('192.0.2.0/24').subnets(prefixlen_diff=2)) #doctest: +NORMALIZE_WHITESPACE Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in list(ip_network('192.0.2.0/24').subnets(prefixlen_diff=2)) #doctest: +NORMALIZE_WHITESPACE NameError: name 'ip_network' is not defined ********************************************************************** File "library/ipaddress.rst", line ?, in default Failed example: list(ip_network('192.0.2.0/24').subnets(new_prefix=26)) #doctest: +NORMALIZE_WHITESPACE Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in list(ip_network('192.0.2.0/24').subnets(new_prefix=26)) #doctest: +NORMALIZE_WHITESPACE NameError: name 'ip_network' is not defined ********************************************************************** File "library/ipaddress.rst", line ?, in default Failed example: list(ip_network('192.0.2.0/24').subnets(new_prefix=23)) Expected: Traceback (most recent call last): File "", line 1, in raise ValueError('new prefix must be longer') ValueError: new prefix must be longer Got: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in list(ip_network('192.0.2.0/24').subnets(new_prefix=23)) NameError: name 'ip_network' is not defined ********************************************************************** File "library/ipaddress.rst", line ?, in default Failed example: list(ip_network('192.0.2.0/24').subnets(new_prefix=25)) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in list(ip_network('192.0.2.0/24').subnets(new_prefix=25)) NameError: name 'ip_network' is not defined ********************************************************************** File "library/ipaddress.rst", line ?, in default Failed example: ip_network('192.0.2.0/24').supernet() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in ip_network('192.0.2.0/24').supernet() NameError: name 'ip_network' is not defined ********************************************************************** File "library/ipaddress.rst", line ?, in default Failed example: ip_network('192.0.2.0/24').supernet(prefixlen_diff=2) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in ip_network('192.0.2.0/24').supernet(prefixlen_diff=2) NameError: name 'ip_network' is not defined ********************************************************************** File "library/ipaddress.rst", line ?, in default Failed example: ip_network('192.0.2.0/24').supernet(new_prefix=20) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in ip_network('192.0.2.0/24').supernet(new_prefix=20) NameError: name 'ip_network' is not defined ********************************************************************** File "library/ipaddress.rst", line ?, in default Failed example: ip_network('192.0.2.1/32').compare_networks(ip_network('192.0.2.2/32')) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in ip_network('192.0.2.1/32').compare_networks(ip_network('192.0.2.2/32')) NameError: name 'ip_network' is not defined ********************************************************************** File "library/ipaddress.rst", line ?, in default Failed example: ip_network('192.0.2.1/32').compare_networks(ip_network('192.0.2.0/32')) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in ip_network('192.0.2.1/32').compare_networks(ip_network('192.0.2.0/32')) NameError: name 'ip_network' is not defined ********************************************************************** File "library/ipaddress.rst", line ?, in default Failed example: ip_network('192.0.2.1/32').compare_networks(ip_network('192.0.2.1/32')) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in ip_network('192.0.2.1/32').compare_networks(ip_network('192.0.2.1/32')) NameError: name 'ip_network' is not defined ********************************************************************** File "library/ipaddress.rst", line ?, in default Failed example: interface = IPv4Interface('192.0.2.5/24') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in interface = IPv4Interface('192.0.2.5/24') NameError: name 'IPv4Interface' is not defined ********************************************************************** File "library/ipaddress.rst", line ?, in default Failed example: interface.ip Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in interface.ip NameError: name 'interface' is not defined ********************************************************************** File "library/ipaddress.rst", line ?, in default Failed example: interface = IPv4Interface('192.0.2.5/24') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in interface = IPv4Interface('192.0.2.5/24') NameError: name 'IPv4Interface' is not defined ********************************************************************** File "library/ipaddress.rst", line ?, in default Failed example: interface.network Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in interface.network NameError: name 'interface' is not defined ********************************************************************** File "library/ipaddress.rst", line ?, in default Failed example: interface = IPv4Interface('192.0.2.5/24') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in interface = IPv4Interface('192.0.2.5/24') NameError: name 'IPv4Interface' is not defined ********************************************************************** File "library/ipaddress.rst", line ?, in default Failed example: interface.with_prefixlen Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in interface.with_prefixlen NameError: name 'interface' is not defined ********************************************************************** File "library/ipaddress.rst", line ?, in default Failed example: interface = IPv4Interface('192.0.2.5/24') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in interface = IPv4Interface('192.0.2.5/24') NameError: name 'IPv4Interface' is not defined ********************************************************************** File "library/ipaddress.rst", line ?, in default Failed example: interface.with_netmask Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in interface.with_netmask NameError: name 'interface' is not defined ********************************************************************** File "library/ipaddress.rst", line ?, in default Failed example: interface = IPv4Interface('192.0.2.5/24') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in interface = IPv4Interface('192.0.2.5/24') NameError: name 'IPv4Interface' is not defined ********************************************************************** File "library/ipaddress.rst", line ?, in default Failed example: interface.with_hostmask Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in interface.with_hostmask NameError: name 'interface' is not defined ********************************************************************** File "library/ipaddress.rst", line 737, in default Failed example: ipaddress.ip_address(3221225985) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in ipaddress.ip_address(3221225985) NameError: name 'ipaddress' is not defined ********************************************************************** File "library/ipaddress.rst", line 739, in default Failed example: ipaddress.v4_int_to_packed(3221225985) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in ipaddress.v4_int_to_packed(3221225985) NameError: name 'ipaddress' is not defined ********************************************************************** File "library/ipaddress.rst", line 761, in default Failed example: [ipaddr for ipaddr in ipaddress.summarize_address_range( ipaddress.IPv4Address('192.0.2.0'), ipaddress.IPv4Address('192.0.2.130'))] Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in [ipaddr for ipaddr in ipaddress.summarize_address_range( NameError: name 'ipaddress' is not defined ********************************************************************** File "library/ipaddress.rst", line 774, in default Failed example: [ipaddr for ipaddr in ipaddress.collapse_addresses([ipaddress.IPv4Network('192.0.2.0/25'), ipaddress.IPv4Network('192.0.2.128/25')])] Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 2, in ipaddress.collapse_addresses([ipaddress.IPv4Network('192.0.2.0/25'), NameError: name 'ipaddress' is not defined ********************************************************************** 1 items had failures: 34 of 34 in default 34 tests in 1 items. 0 passed and 34 failed. ***Test Failed*** 34 failures. Document: library/functions --------------------------- ********************************************************************** File "library/functions.rst", line ?, in default Failed example: dir() # show the names in the module namespace Expected: ['__builtins__', '__name__', 'struct'] Got: ['__builtins__', 'struct'] ********************************************************************** 1 items had failures: 1 of 12 in default 12 tests in 1 items. 11 passed and 1 failed. ***Test Failed*** 1 failures. Document: library/datetime -------------------------- 1 items passed all tests: 60 tests in default 60 tests in 1 items. 60 passed and 0 failed. Test passed. Document: library/http.cookies ------------------------------ 1 items passed all tests: 30 tests in default 30 tests in 1 items. 30 passed and 0 failed. Test passed. Document: howto/sorting ----------------------- ********************************************************************** File "howto/sorting.rst", line ?, in default Failed example: student_tuples = [ Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "/home/beni/pycon/cpython/Doc/toolsenv/lib/python3.4/site-packages/sphinx/ext/doctest.py", line 349, in compile return compile(code, name, self.type, flags, dont_inherit) File "", line 1 student_tuples = [ ^ SyntaxError: unexpected EOF while parsing ********************************************************************** File "howto/sorting.rst", line ?, in default Failed example: sorted(student_tuples, key=lambda student: student[2]) # sort by age Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in sorted(student_tuples, key=lambda student: student[2]) # sort by age NameError: name 'student_tuples' is not defined ********************************************************************** File "howto/sorting.rst", line ?, in default Failed example: class Student: Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "/home/beni/pycon/cpython/Doc/toolsenv/lib/python3.4/site-packages/sphinx/ext/doctest.py", line 349, in compile return compile(code, name, self.type, flags, dont_inherit) File "", line 1 class Student: ^ SyntaxError: unexpected EOF while parsing ********************************************************************** File "howto/sorting.rst", line ?, in default Failed example: student_objects = [ Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "/home/beni/pycon/cpython/Doc/toolsenv/lib/python3.4/site-packages/sphinx/ext/doctest.py", line 349, in compile return compile(code, name, self.type, flags, dont_inherit) File "", line 1 student_objects = [ ^ SyntaxError: unexpected EOF while parsing ********************************************************************** File "howto/sorting.rst", line ?, in default Failed example: sorted(student_objects, key=lambda student: student.age) # sort by age Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in sorted(student_objects, key=lambda student: student.age) # sort by age NameError: name 'student_objects' is not defined ********************************************************************** File "howto/sorting.rst", line ?, in default Failed example: sorted(student_tuples, key=itemgetter(2)) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in sorted(student_tuples, key=itemgetter(2)) NameError: name 'student_tuples' is not defined ********************************************************************** File "howto/sorting.rst", line ?, in default Failed example: sorted(student_objects, key=attrgetter('age')) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in sorted(student_objects, key=attrgetter('age')) NameError: name 'student_objects' is not defined ********************************************************************** File "howto/sorting.rst", line ?, in default Failed example: sorted(student_tuples, key=itemgetter(1,2)) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in sorted(student_tuples, key=itemgetter(1,2)) NameError: name 'student_tuples' is not defined ********************************************************************** File "howto/sorting.rst", line ?, in default Failed example: sorted(student_objects, key=attrgetter('grade', 'age')) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in sorted(student_objects, key=attrgetter('grade', 'age')) NameError: name 'student_objects' is not defined ********************************************************************** File "howto/sorting.rst", line ?, in default Failed example: sorted(student_tuples, key=itemgetter(2), reverse=True) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in sorted(student_tuples, key=itemgetter(2), reverse=True) NameError: name 'student_tuples' is not defined ********************************************************************** File "howto/sorting.rst", line ?, in default Failed example: sorted(student_objects, key=attrgetter('age'), reverse=True) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in sorted(student_objects, key=attrgetter('age'), reverse=True) NameError: name 'student_objects' is not defined ********************************************************************** File "howto/sorting.rst", line ?, in default Failed example: s = sorted(student_objects, key=attrgetter('age')) # sort on secondary key Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in s = sorted(student_objects, key=attrgetter('age')) # sort on secondary key NameError: name 'student_objects' is not defined ********************************************************************** File "howto/sorting.rst", line ?, in default Failed example: sorted(s, key=attrgetter('grade'), reverse=True) # now sort on primary key, descending Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in sorted(s, key=attrgetter('grade'), reverse=True) # now sort on primary key, descending NameError: name 's' is not defined ********************************************************************** File "howto/sorting.rst", line ?, in default Failed example: decorated = [(student.grade, i, student) for i, student in enumerate(student_objects)] Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in decorated = [(student.grade, i, student) for i, student in enumerate(student_objects)] NameError: name 'student_objects' is not defined ********************************************************************** File "howto/sorting.rst", line ?, in default Failed example: decorated.sort() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in decorated.sort() NameError: name 'decorated' is not defined ********************************************************************** File "howto/sorting.rst", line ?, in default Failed example: [student for grade, i, student in decorated] # undecorate Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in [student for grade, i, student in decorated] # undecorate NameError: name 'decorated' is not defined ********************************************************************** File "howto/sorting.rst", line ?, in default Failed example: def numeric_compare(x, y): Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "/home/beni/pycon/cpython/Doc/toolsenv/lib/python3.4/site-packages/sphinx/ext/doctest.py", line 349, in compile return compile(code, name, self.type, flags, dont_inherit) File "", line 1 def numeric_compare(x, y): ^ SyntaxError: unexpected EOF while parsing ********************************************************************** File "howto/sorting.rst", line ?, in default Failed example: sorted([5, 2, 4, 1, 3], cmp=numeric_compare) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in sorted([5, 2, 4, 1, 3], cmp=numeric_compare) NameError: name 'numeric_compare' is not defined ********************************************************************** File "howto/sorting.rst", line ?, in default Failed example: def reverse_numeric(x, y): Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "/home/beni/pycon/cpython/Doc/toolsenv/lib/python3.4/site-packages/sphinx/ext/doctest.py", line 349, in compile return compile(code, name, self.type, flags, dont_inherit) File "", line 1 def reverse_numeric(x, y): ^ SyntaxError: unexpected EOF while parsing ********************************************************************** File "howto/sorting.rst", line ?, in default Failed example: sorted([5, 2, 4, 1, 3], cmp=reverse_numeric) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in sorted([5, 2, 4, 1, 3], cmp=reverse_numeric) NameError: name 'reverse_numeric' is not defined ********************************************************************** File "howto/sorting.rst", line ?, in default Failed example: sorted([5, 2, 4, 1, 3], key=cmp_to_key(reverse_numeric)) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in sorted([5, 2, 4, 1, 3], key=cmp_to_key(reverse_numeric)) NameError: name 'cmp_to_key' is not defined ********************************************************************** 1 items had failures: 21 of 34 in default 34 tests in 1 items. 13 passed and 21 failed. ***Test Failed*** 21 failures. Document: whatsnew/3.2 ---------------------- ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: collections.__cached__ Expected: 'c:/py32/lib/__pycache__/collections.cpython-32.pyc' Got: '/home/beni/pycon/cpython/Lib/collections/__pycache__/__init__.cpython-34.pyc' ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: imp.get_tag() Expected: 'cpython-32' Got: 'cpython-34' ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: imp.cache_from_source('c:/py32/lib/collections.py') Expected: 'c:/py32/lib/__pycache__/collections.cpython-32.pyc' Got: 'c:/py32/lib/__pycache__/collections.cpython-34.pyc' ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: with memoryview(b'abcdefgh') as v: Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "/home/beni/pycon/cpython/Doc/toolsenv/lib/python3.4/site-packages/sphinx/ext/doctest.py", line 349, in compile return compile(code, name, self.type, flags, dont_inherit) File "", line 1 with memoryview(b'abcdefgh') as v: ^ SyntaxError: unexpected EOF while parsing ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: isinstance(sys.version_info, tuple) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in isinstance(sys.version_info, tuple) NameError: name 'sys' is not defined ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: 'Version %d.%d.%d %s(%d)' % sys.version_info Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in 'Version %d.%d.%d %s(%d)' % sys.version_info NameError: name 'sys' is not defined ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: @functools.lru_cache(maxsize=300) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "/home/beni/pycon/cpython/Doc/toolsenv/lib/python3.4/site-packages/sphinx/ext/doctest.py", line 349, in compile return compile(code, name, self.type, flags, dont_inherit) File "", line 1 @functools.lru_cache(maxsize=300) ^ SyntaxError: unexpected EOF while parsing ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: def get_phone_number(name): Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "/home/beni/pycon/cpython/Doc/toolsenv/lib/python3.4/site-packages/sphinx/ext/doctest.py", line 349, in compile return compile(code, name, self.type, flags, dont_inherit) File "", line 1 def get_phone_number(name): ^ SyntaxError: unexpected EOF while parsing ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: for name in user_requests: Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "/home/beni/pycon/cpython/Doc/toolsenv/lib/python3.4/site-packages/sphinx/ext/doctest.py", line 349, in compile return compile(code, name, self.type, flags, dont_inherit) File "", line 1 for name in user_requests: ^ SyntaxError: unexpected EOF while parsing ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: get_phone_number.cache_info() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in get_phone_number.cache_info() NameError: name 'get_phone_number' is not defined ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: get_phone_number.cache_clear() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in get_phone_number.cache_clear() NameError: name 'get_phone_number' is not defined ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: get_phone_number = get_phone_number.__wrapped__ # uncached function Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in get_phone_number = get_phone_number.__wrapped__ # uncached function NameError: name 'get_phone_number' is not defined ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: sorted(iterable, key=cmp_to_key(locale.strcoll)) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in sorted(iterable, key=cmp_to_key(locale.strcoll)) NameError: name 'iterable' is not defined ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: tally = Counter(dogs=5, cat=3) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in tally = Counter(dogs=5, cat=3) NameError: name 'Counter' is not defined ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: tally -= Counter(dogs=2, cats=8) # saturating subtraction Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in tally -= Counter(dogs=2, cats=8) # saturating subtraction NameError: name 'tally' is not defined ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: tally Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in tally NameError: name 'tally' is not defined ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: tally = Counter(dogs=5, cats=3) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in tally = Counter(dogs=5, cats=3) NameError: name 'Counter' is not defined ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: tally.subtract(dogs=2, cats=8) # regular subtraction Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in tally.subtract(dogs=2, cats=8) # regular subtraction NameError: name 'tally' is not defined ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: tally Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in tally NameError: name 'tally' is not defined ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: d = OrderedDict.fromkeys(['a', 'b', 'X', 'd', 'e']) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in d = OrderedDict.fromkeys(['a', 'b', 'X', 'd', 'e']) NameError: name 'OrderedDict' is not defined ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: list(d) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in list(d) NameError: name 'd' is not defined ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: d.move_to_end('X') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in d.move_to_end('X') NameError: name 'd' is not defined ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: list(d) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in list(d) NameError: name 'd' is not defined ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: d = deque('simsalabim') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in d = deque('simsalabim') NameError: name 'deque' is not defined ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: d.count('s') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in d.count('s') NameError: name 'd' is not defined ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: d.reverse() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in d.reverse() NameError: name 'd' is not defined ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: d Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in d NameError: name 'd' is not defined ********************************************************************** File "whatsnew/3.2.rst", line 1037, in default Failed example: [isfinite(x) for x in (123, 4.56, float('Nan'), float('Inf'))] Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in [isfinite(x) for x in (123, 4.56, float('Nan'), float('Inf'))] File "", line 1, in [isfinite(x) for x in (123, 4.56, float('Nan'), float('Inf'))] NameError: name 'isfinite' is not defined ********************************************************************** File "whatsnew/3.2.rst", line 1044, in default Failed example: expm1(0.013671875) # more accurate way to compute e**x-1 for a small x Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in expm1(0.013671875) # more accurate way to compute e**x-1 for a small x NameError: name 'expm1' is not defined ********************************************************************** File "whatsnew/3.2.rst", line 1055, in default Failed example: erf(1.0/sqrt(2.0)) # portion of normal distribution within 1 standard deviation Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in erf(1.0/sqrt(2.0)) # portion of normal distribution within 1 standard deviation NameError: name 'erf' is not defined ********************************************************************** File "whatsnew/3.2.rst", line 1057, in default Failed example: erfc(1.0/sqrt(2.0)) # portion of normal distribution outside 1 standard deviation Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in erfc(1.0/sqrt(2.0)) # portion of normal distribution outside 1 standard deviation NameError: name 'erfc' is not defined ********************************************************************** File "whatsnew/3.2.rst", line 1059, in default Failed example: erf(1.0/sqrt(2.0)) + erfc(1.0/sqrt(2.0)) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in erf(1.0/sqrt(2.0)) + erfc(1.0/sqrt(2.0)) NameError: name 'erf' is not defined ********************************************************************** File "whatsnew/3.2.rst", line 1066, in default Failed example: gamma(7.0) # six factorial Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in gamma(7.0) # six factorial NameError: name 'gamma' is not defined ********************************************************************** File "whatsnew/3.2.rst", line 1068, in default Failed example: lgamma(801.0) # log(800 factorial) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in lgamma(801.0) # log(800 factorial) NameError: name 'lgamma' is not defined ********************************************************************** File "whatsnew/3.2.rst", line 1282, in default Failed example: sys.hash_info Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in sys.hash_info NameError: name 'sys' is not defined ********************************************************************** File "whatsnew/3.2.rst", line 1307, in default Failed example: Decimal(1.1) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in Decimal(1.1) NameError: name 'Decimal' is not defined ********************************************************************** File "whatsnew/3.2.rst", line 1309, in default Failed example: Fraction(1.1) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in Fraction(1.1) NameError: name 'Fraction' is not defined ********************************************************************** File "whatsnew/3.2.rst", line 1370, in default Failed example: select.PIPE_BUF Expected: 512 Got: 4096 ********************************************************************** File "whatsnew/3.2.rst", line 1400, in default Failed example: c = gzip.compress(b) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in c = gzip.compress(b) NameError: name 'gzip' is not defined ********************************************************************** File "whatsnew/3.2.rst", line 1401, in default Failed example: len(c) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in len(c) NameError: name 'c' is not defined ********************************************************************** File "whatsnew/3.2.rst", line 1403, in default Failed example: gzip.decompress(c).decode()[:42] # decompress and convert to text Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in gzip.decompress(c).decode()[:42] # decompress and convert to text NameError: name 'gzip' is not defined ********************************************************************** File "whatsnew/3.2.rst", line 1500, in default Failed example: os.fsencode(filename) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in os.fsencode(filename) NameError: name 'os' is not defined ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: TestCase().assertEqual(pow(2, 3), 8) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in TestCase().assertEqual(pow(2, 3), 8) NameError: name 'TestCase' is not defined ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: urllib.parse.urlparse('http://[dead:beef:cafe:5417:affe:8FA3:deaf:feed]/foo/') Expected: ParseResult(scheme='http', netloc='[dead:beef:cafe:5417:affe:8FA3:deaf:feed]', path='/foo/', params='', query='', fragment='') Got: ParseResult(scheme='http', netloc='[dead:beef:cafe:5417:affe:8FA3:deaf:feed]', path='/foo/', params='', query='', fragment='') ********************************************************************** File "whatsnew/3.2.rst", line ?, in default Failed example: urllib.parse.urlparse(b'http://www.python.org:80/about/') Expected: ParseResultBytes(scheme=b'http', netloc=b'www.python.org:80', path=b'/about/', params=b'', query=b'', fragment=b'') Got: ParseResultBytes(scheme=b'http', netloc=b'www.python.org:80', path=b'/about/', params=b'', query=b'', fragment=b'') ********************************************************************** 1 items had failures: 45 of 69 in default 69 tests in 1 items. 24 passed and 45 failed. ***Test Failed*** 45 failures. Document: library/time ---------------------- 1 items passed all tests: 2 tests in default 2 tests in 1 items. 2 passed and 0 failed. Test passed. Document: whatsnew/2.7 ---------------------- ********************************************************************** File "whatsnew/2.7.rst", line ?, in default Failed example: m = memoryview(string.letters) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in m = memoryview(string.letters) AttributeError: 'module' object has no attribute 'letters' ********************************************************************** File "whatsnew/2.7.rst", line ?, in default Failed example: m Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in m NameError: name 'm' is not defined ********************************************************************** File "whatsnew/2.7.rst", line ?, in default Failed example: len(m) # Returns length of underlying object Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in len(m) # Returns length of underlying object NameError: name 'm' is not defined ********************************************************************** File "whatsnew/2.7.rst", line ?, in default Failed example: m[0], m[25], m[26] # Indexing returns one byte Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in m[0], m[25], m[26] # Indexing returns one byte NameError: name 'm' is not defined ********************************************************************** File "whatsnew/2.7.rst", line ?, in default Failed example: m2 = m[0:26] # Slicing returns another memoryview Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in m2 = m[0:26] # Slicing returns another memoryview NameError: name 'm' is not defined ********************************************************************** File "whatsnew/2.7.rst", line ?, in default Failed example: m2 Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in m2 NameError: name 'm2' is not defined ********************************************************************** File "whatsnew/2.7.rst", line ?, in default Failed example: m2.tobytes() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in m2.tobytes() NameError: name 'm2' is not defined ********************************************************************** File "whatsnew/2.7.rst", line ?, in default Failed example: m2.tolist() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in m2.tolist() NameError: name 'm2' is not defined ********************************************************************** File "whatsnew/2.7.rst", line ?, in default Failed example: m2[0] = 75 Expected: Traceback (most recent call last): File "", line 1, in TypeError: cannot modify read-only memory Got: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in m2[0] = 75 NameError: name 'm2' is not defined ********************************************************************** File "whatsnew/2.7.rst", line ?, in default Failed example: b = bytearray(string.letters) # Creating a mutable object Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in b = bytearray(string.letters) # Creating a mutable object AttributeError: 'module' object has no attribute 'letters' ********************************************************************** File "whatsnew/2.7.rst", line ?, in default Failed example: b Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in b NameError: name 'b' is not defined ********************************************************************** File "whatsnew/2.7.rst", line ?, in default Failed example: mb = memoryview(b) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mb = memoryview(b) NameError: name 'b' is not defined ********************************************************************** File "whatsnew/2.7.rst", line ?, in default Failed example: mb[0] = '*' # Assign to view, changing the bytearray. Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in mb[0] = '*' # Assign to view, changing the bytearray. NameError: name 'mb' is not defined ********************************************************************** File "whatsnew/2.7.rst", line ?, in default Failed example: b[0:5] # The bytearray has been changed. Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in b[0:5] # The bytearray has been changed. NameError: name 'b' is not defined ********************************************************************** File "whatsnew/2.7.rst", line ?, in default Failed example: {1,2,3,4,5} Expected: set([1, 2, 3, 4, 5]) Got: {1, 2, 3, 4, 5} ********************************************************************** File "whatsnew/2.7.rst", line ?, in default Failed example: set() # empty set Expected: set([]) Got: set() ********************************************************************** File "whatsnew/2.7.rst", line ?, in default Failed example: {('a'*x) for x in range(6)} Expected: set(['', 'a', 'aa', 'aaa', 'aaaa', 'aaaaa']) Got: {'', 'aaaaa', 'aaaa', 'aaa', 'a', 'aa'} ********************************************************************** File "whatsnew/2.7.rst", line 1012, in default Failed example: c Expected: Counter({' ': 6, 'e': 5, 's': 3, 'a': 2, 'i': 2, 'h': 2, 'l': 2, 't': 2, 'g': 1, 'f': 1, 'm': 1, 'o': 1, 'n': 1, 'p': 1, 'r': 1, 'x': 1}) Got: Counter({' ': 6, 'e': 5, 's': 3, 'h': 2, 'i': 2, 'l': 2, 'a': 2, 't': 2, 'm': 1, 'n': 1, 'o': 1, 'f': 1, 'g': 1, 'x': 1, 'p': 1, 'r': 1}) ********************************************************************** File "whatsnew/2.7.rst", line ?, in default Failed example: import urlparse Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in import urlparse ImportError: No module named 'urlparse' ********************************************************************** File "whatsnew/2.7.rst", line ?, in default Failed example: urlparse.urlsplit('invented://host/filename?query') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in urlparse.urlsplit('invented://host/filename?query') NameError: name 'urlparse' is not defined ********************************************************************** File "whatsnew/2.7.rst", line ?, in default Failed example: import urlparse Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in import urlparse ImportError: No module named 'urlparse' ********************************************************************** File "whatsnew/2.7.rst", line ?, in default Failed example: urlparse.urlsplit('invented://host/filename?query') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in urlparse.urlsplit('invented://host/filename?query') NameError: name 'urlparse' is not defined ********************************************************************** File "whatsnew/2.7.rst", line ?, in default Failed example: import urlparse Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in import urlparse ImportError: No module named 'urlparse' ********************************************************************** File "whatsnew/2.7.rst", line ?, in default Failed example: urlparse.urlsplit('invented://host/filename?query') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in urlparse.urlsplit('invented://host/filename?query') NameError: name 'urlparse' is not defined ********************************************************************** File "whatsnew/2.7.rst", line ?, in default Failed example: import urlparse Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in import urlparse ImportError: No module named 'urlparse' ********************************************************************** File "whatsnew/2.7.rst", line ?, in default Failed example: urlparse.urlsplit('invented://host/filename?query') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in urlparse.urlsplit('invented://host/filename?query') NameError: name 'urlparse' is not defined ********************************************************************** 1 items had failures: 26 of 38 in default 38 tests in 1 items. 12 passed and 26 failed. ***Test Failed*** 26 failures. Document: library/multiprocessing --------------------------------- ********************************************************************** File "library/multiprocessing.rst", line 1598, in default Failed example: l._callmethod('__getslice__', (2, 7)) # equiv to `l[2:7]` Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in l._callmethod('__getslice__', (2, 7)) # equiv to `l[2:7]` File "/home/beni/pycon/cpython/Lib/multiprocessing/managers.py", line 741, in _callmethod raise convert_to_error(kind, result) multiprocessing.managers.RemoteError: --------------------------------------------------------------------------- Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/multiprocessing/managers.py", line 232, in serve_client (methodname, type(obj), exposed) AttributeError: method '__getslice__' of object is not in exposed={'sort', 'extend', '__mul__', '__rmul__', '__delitem__', 'count', 'pop', 'remove', 'reverse', '__contains__', '__getitem__', 'insert', '__len__', '__setitem__', '__imul__', '__reversed__', 'index', 'append', '__add__'} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/multiprocessing/managers.py", line 255, in serve_client fallback_func = self.fallback_mapping[methodname] KeyError: '__getslice__' --------------------------------------------------------------------------- ********************************************************************** 1 items had failures: 1 of 46 in default 46 tests in 1 items. 45 passed and 1 failed. ***Test Failed*** 1 failures. Document: library/stdtypes -------------------------- 1 items passed all tests: 29 tests in default 29 tests in 1 items. 29 passed and 0 failed. Test passed. Document: library/hashlib ------------------------- ********************************************************************** File "library/hashlib.rst", line ?, in default Failed example: hashlib.sha224(b"Nobody inspects the spammish repetition").hexdigest() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in hashlib.sha224(b"Nobody inspects the spammish repetition").hexdigest() NameError: name 'hashlib' is not defined ********************************************************************** File "library/hashlib.rst", line ?, in default Failed example: h = hashlib.new('ripemd160') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in h = hashlib.new('ripemd160') NameError: name 'hashlib' is not defined ********************************************************************** File "library/hashlib.rst", line ?, in default Failed example: h.update(b"Nobody inspects the spammish repetition") Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in h.update(b"Nobody inspects the spammish repetition") NameError: name 'h' is not defined ********************************************************************** File "library/hashlib.rst", line ?, in default Failed example: h.hexdigest() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in h.hexdigest() NameError: name 'h' is not defined ********************************************************************** 1 items had failures: 4 of 4 in default 4 tests in 1 items. 0 passed and 4 failed. ***Test Failed*** 4 failures. Document: library/reprlib ------------------------- ********************************************************************** File "library/reprlib.rst", line ?, in default Failed example: class MyList(list): @recursive_repr() def __repr__(self): return '<' + '|'.join(map(repr, self)) + '>' Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "/home/beni/pycon/cpython/Doc/toolsenv/lib/python3.4/site-packages/sphinx/ext/doctest.py", line 349, in compile return compile(code, name, self.type, flags, dont_inherit) File "", line 3 def __repr__(self): ^ IndentationError: unexpected indent ********************************************************************** File "library/reprlib.rst", line ?, in default Failed example: m = MyList('abc') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in m = MyList('abc') NameError: name 'MyList' is not defined ********************************************************************** File "library/reprlib.rst", line ?, in default Failed example: m.append(m) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in m.append(m) NameError: name 'm' is not defined ********************************************************************** File "library/reprlib.rst", line ?, in default Failed example: m.append('x') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in m.append('x') NameError: name 'm' is not defined ********************************************************************** File "library/reprlib.rst", line ?, in default Failed example: print(m) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in print(m) NameError: name 'm' is not defined ********************************************************************** 1 items had failures: 5 of 5 in default 5 tests in 1 items. 0 passed and 5 failed. ***Test Failed*** 5 failures. Document: library/urllib.robotparser ------------------------------------ ********************************************************************** File "library/urllib.robotparser.rst", line ?, in default Failed example: rp.can_fetch("*", "http://www.musi-cal.com/cgi-bin/search?city=San+Francisco") Expected: False Got: True ********************************************************************** 1 items had failures: 1 of 6 in default 6 tests in 1 items. 5 passed and 1 failed. ***Test Failed*** 1 failures. Document: tutorial/interpreter ------------------------------ ********************************************************************** File "tutorial/interpreter.rst", line ?, in default Failed example: site.getusersitepackages() Expected: '/home/user/.local/lib/python3.2/site-packages' Got: '/home/beni/.local/lib/python3.4/site-packages' ********************************************************************** 1 items had failures: 1 of 2 in default 2 tests in 1 items. 1 passed and 1 failed. ***Test Failed*** 1 failures. Document: library/math ---------------------- Document: library/unicodedata ----------------------------- 1 items passed all tests: 7 tests in default 7 tests in 1 items. 7 passed and 0 failed. Test passed. Document: library/operator -------------------------- 1 items passed all tests: 16 tests in default 16 tests in 1 items. 16 passed and 0 failed. Test passed. Document: howto/ipaddress ------------------------- ********************************************************************** File "howto/ipaddress.rst", line ?, in default Failed example: ipaddress.ip_interface('192.0.2.1/24') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in ipaddress.ip_interface('192.0.2.1/24') NameError: name 'ipaddress' is not defined ********************************************************************** File "howto/ipaddress.rst", line ?, in default Failed example: ipaddress.ip_interface('2001:db8::1/96') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in ipaddress.ip_interface('2001:db8::1/96') NameError: name 'ipaddress' is not defined ********************************************************************** File "howto/ipaddress.rst", line ?, in default Failed example: net4 = ipaddress.ip_network('192.0.2.0/24') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in net4 = ipaddress.ip_network('192.0.2.0/24') NameError: name 'ipaddress' is not defined ********************************************************************** File "howto/ipaddress.rst", line ?, in default Failed example: net4.netmask Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in net4.netmask NameError: name 'net4' is not defined ********************************************************************** File "howto/ipaddress.rst", line ?, in default Failed example: net4.hostmask Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in net4.hostmask NameError: name 'net4' is not defined ********************************************************************** File "howto/ipaddress.rst", line ?, in default Failed example: net6 = ipaddress.ip_network('2001:db8::0/96') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in net6 = ipaddress.ip_network('2001:db8::0/96') NameError: name 'ipaddress' is not defined ********************************************************************** File "howto/ipaddress.rst", line ?, in default Failed example: net6.netmask Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in net6.netmask NameError: name 'net6' is not defined ********************************************************************** File "howto/ipaddress.rst", line ?, in default Failed example: net6.hostmask Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in net6.hostmask NameError: name 'net6' is not defined ********************************************************************** 1 items had failures: 8 of 8 in default 8 tests in 1 items. 0 passed and 8 failed. ***Test Failed*** 8 failures. Document: library/copyreg ------------------------- ********************************************************************** File "library/copyreg.rst", line ?, in default Failed example: p = pickle.dumps(c) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in p = pickle.dumps(c) _pickle.PicklingError: Can't pickle : attribute lookup builtins.C failed ********************************************************************** 1 items had failures: 1 of 7 in default 7 tests in 1 items. 6 passed and 1 failed. ***Test Failed*** 1 failures. Document: library/shlex ----------------------- ********************************************************************** File "library/shlex.rst", line ?, in default Failed example: remote_command = split(remote_command) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in remote_command = split(remote_command) NameError: name 'split' is not defined ********************************************************************** File "library/shlex.rst", line ?, in default Failed example: remote_command Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in remote_command NameError: name 'remote_command' is not defined ********************************************************************** File "library/shlex.rst", line ?, in default Failed example: command = split(remote_command[-1]) Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in command = split(remote_command[-1]) NameError: name 'split' is not defined ********************************************************************** File "library/shlex.rst", line ?, in default Failed example: command Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in command NameError: name 'command' is not defined ********************************************************************** 1 items had failures: 4 of 4 in default 4 tests in 1 items. 0 passed and 4 failed. ***Test Failed*** 4 failures. Document: library/ftplib ------------------------ ********************************************************************** File "library/ftplib.rst", line ?, in default Failed example: with FTP("ftp1.at.proftpd.org") as ftp: ftp.login() ftp.dir() Expected: '230 Anonymous login ok, restrictions apply.' dr-xr-xr-x 9 ftp ftp 154 May 6 10:43 . dr-xr-xr-x 9 ftp ftp 154 May 6 10:43 .. dr-xr-xr-x 5 ftp ftp 4096 May 6 10:43 CentOS dr-xr-xr-x 3 ftp ftp 18 Jul 10 2008 Fedora Got: '230 Anonymous access granted, restrictions apply' -rw-rw-r-- 1 ftp ftp 451 Jul 1 2005 README.MIRRORS drwxrwxr-x 3 ftp ftp 4096 Jul 1 2005 devel drwxrwxr-x 3 ftp ftp 4096 Dec 2 2010 distrib drwxrwxr-x 4 ftp ftp 4096 Jul 1 2005 historic ********************************************************************** File "library/ftplib.rst", line 117, in default Failed example: ftps = FTP_TLS('ftp.python.org') Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in ftps = FTP_TLS('ftp.python.org') File "/home/beni/pycon/cpython/Lib/ftplib.py", line 722, in __init__ FTP.__init__(self, host, user, passwd, acct, timeout, source_address) File "/home/beni/pycon/cpython/Lib/ftplib.py", line 115, in __init__ self.connect(host) File "/home/beni/pycon/cpython/Lib/ftplib.py", line 149, in connect source_address=self.source_address) File "/home/beni/pycon/cpython/Lib/socket.py", line 435, in create_connection raise err File "/home/beni/pycon/cpython/Lib/socket.py", line 426, in create_connection sock.connect(sa) OSError: [Errno 101] Network is unreachable ********************************************************************** File "library/ftplib.rst", line 118, in default Failed example: ftps.login() # login anonymously before securing control channel Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in ftps.login() # login anonymously before securing control channel NameError: name 'ftps' is not defined ********************************************************************** File "library/ftplib.rst", line 119, in default Failed example: ftps.prot_p() # switch to secure data connection Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in ftps.prot_p() # switch to secure data connection NameError: name 'ftps' is not defined ********************************************************************** File "library/ftplib.rst", line 120, in default Failed example: ftps.retrlines('LIST') # list directory content securely Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in ftps.retrlines('LIST') # list directory content securely NameError: name 'ftps' is not defined ********************************************************************** File "library/ftplib.rst", line 132, in default Failed example: ftps.quit() Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "", line 1, in ftps.quit() NameError: name 'ftps' is not defined ********************************************************************** 1 items had failures: 6 of 8 in default 8 tests in 1 items. 2 passed and 6 failed. ***Test Failed*** 6 failures. Document: library/difflib ------------------------- ********************************************************************** File "library/difflib.rst", line ?, in default Failed example: for line in context_diff(s1, s2, fromfile='before.py', tofile='after.py'): sys.stdout.write(line) # doctest: +NORMALIZE_WHITESPACE Expected: *** before.py --- after.py *************** *** 1,4 **** ! bacon ! eggs ! ham guido --- 1,4 ---- ! python ! eggy ! hamster guido Got: *** before.py 14 --- after.py 13 *************** 16 *** 1,4 **** 13 ! bacon 8 ! eggs 7 ! ham 6 guido 8 --- 1,4 ---- 13 ! python 9 ! eggy 7 ! hamster 10 guido 8 ********************************************************************** File "library/difflib.rst", line ?, in default Failed example: get_close_matches('apple', keyword.kwlist) Expected: [] Got: ['False'] ********************************************************************** File "library/difflib.rst", line ?, in default Failed example: for line in unified_diff(s1, s2, fromfile='before.py', tofile='after.py'): sys.stdout.write(line) # doctest: +NORMALIZE_WHITESPACE Expected: --- before.py +++ after.py @@ -1,4 +1,4 @@ -bacon -eggs -ham +python +eggy +hamster guido Got: --- before.py 14 +++ after.py 13 @@ -1,4 +1,4 @@ 16 -bacon 7 -eggs 6 -ham 5 +python 8 +eggy 6 +hamster 9 guido 7 ********************************************************************** File "library/difflib.rst", line 449, in default Failed example: s.get_matching_blocks() Expected: [Match(a=0, b=0, size=2), Match(a=3, b=2, size=2), Match(a=5, b=4, size=0)] Got: ********************************************************************** File "library/difflib.rst", line ?, in default Failed example: for tag, i1, i2, j1, j2 in s.get_opcodes(): Exception raised: Traceback (most recent call last): File "/home/beni/pycon/cpython/Lib/doctest.py", line 1290, in __run compileflags, 1), test.globs) File "/home/beni/pycon/cpython/Doc/toolsenv/lib/python3.4/site-packages/sphinx/ext/doctest.py", line 349, in compile return compile(code, name, self.type, flags, dont_inherit) File "", line 1 for tag, i1, i2, j1, j2 in s.get_opcodes(): ^ SyntaxError: unexpected EOF while parsing ********************************************************************** 1 items had failures: 5 of 46 in default 46 tests in 1 items. 41 passed and 5 failed. ***Test Failed*** 5 failures. Document: library/traceback --------------------------- ********************************************************************** File "library/traceback.rst", line 327, in default Failed example: import sys, traceback def lumberjack(): bright_side_of_death() def bright_side_of_death(): return tuple()[0] try: lumberjack() except IndexError: exc_type, exc_value, exc_traceback = sys.exc_info() print("*** print_tb:") traceback.print_tb(exc_traceback, limit=1, file=sys.stdout) print("*** print_exception:") traceback.print_exception(exc_type, exc_value, exc_traceback, limit=2, file=sys.stdout) print("*** print_exc:") traceback.print_exc() print("*** format_exc, first and last line:") formatted_lines = traceback.format_exc().splitlines() print(formatted_lines[0]) print(formatted_lines[-1]) print("*** format_exception:") print(repr(traceback.format_exception(exc_type, exc_value, exc_traceback))) print("*** extract_tb:") print(repr(traceback.extract_tb(exc_traceback))) print("*** format_tb:") print(repr(traceback.format_tb(exc_traceback))) print("*** tb_lineno:", exc_traceback.tb_lineno) Expected: *** print_tb: File "", line 10, in lumberjack() *** print_exception: Traceback (most recent call last): File "", line 10, in lumberjack() File "", line 4, in lumberjack bright_side_of_death() IndexError: tuple index out of range *** print_exc: Traceback (most recent call last): File "", line 10, in lumberjack() File "", line 4, in lumberjack bright_side_of_death() IndexError: tuple index out of range *** format_exc, first and last line: Traceback (most recent call last): IndexError: tuple index out of range *** format_exception: ['Traceback (most recent call last):\n', ' File "", line 10, in \n lumberjack()\n', ' File "", line 4, in lumberjack\n bright_side_of_death()\n', ' File "", line 7, in bright_side_of_death\n return tuple()[0]\n', 'IndexError: tuple index out of range\n'] *** extract_tb: [('', 10, '', 'lumberjack()'), ('', 4, 'lumberjack', 'bright_side_of_death()'), ('', 7, 'bright_side_of_death', 'return tuple()[0]')] *** format_tb: [' File "", line 10, in \n lumberjack()\n', ' File "", line 4, in lumberjack\n bright_side_of_death()\n', ' File "", line 7, in bright_side_of_death\n return tuple()[0]\n'] *** tb_lineno: 10 Got: *** print_tb: File "", line 10, in lumberjack() *** print_exception: Traceback (most recent call last): File "", line 10, in lumberjack() File "", line 4, in lumberjack bright_side_of_death() IndexError: tuple index out of range *** print_exc: *** format_exc, first and last line: Traceback (most recent call last): IndexError: tuple index out of range *** format_exception: ['Traceback (most recent call last):\n', ' File "", line 10, in \n lumberjack()\n', ' File "", line 4, in lumberjack\n bright_side_of_death()\n', ' File "", line 7, in bright_side_of_death\n return tuple()[0]\n', 'IndexError: tuple index out of range\n'] *** extract_tb: [('', 10, '', 'lumberjack()'), ('', 4, 'lumberjack', 'bright_side_of_death()'), ('', 7, 'bright_side_of_death', 'return tuple()[0]')] *** format_tb: [' File "", line 10, in \n lumberjack()\n', ' File "", line 4, in lumberjack\n bright_side_of_death()\n', ' File "", line 7, in bright_side_of_death\n return tuple()[0]\n'] *** tb_lineno: 10 ********************************************************************** 1 items had failures: 1 of 5 in default 5 tests in 1 items. 4 passed and 1 failed. ***Test Failed*** 1 failures. Document: library/re -------------------- ********************************************************************** File "library/re.rst", line ?, in default Failed example: m.groupdict() Expected: {'first_name': 'Malcolm', 'last_name': 'Reynolds'} Got: {'last_name': 'Reynolds', 'first_name': 'Malcolm'} ********************************************************************** 1 items had failures: 1 of 68 in default 68 tests in 1 items. 67 passed and 1 failed. ***Test Failed*** 1 failures. Document: library/base64 ------------------------ 1 items passed all tests: 5 tests in default 5 tests in 1 items. 5 passed and 0 failed. Test passed. Document: library/fnmatch ------------------------- ********************************************************************** File "library/fnmatch.rst", line ?, in default Failed example: regex Expected: '.*\\.txt$' Got: '.*\\.txt\\Z(?ms)' ********************************************************************** 1 items had failures: 1 of 5 in default 5 tests in 1 items. 4 passed and 1 failed. ***Test Failed*** 1 failures. Document: howto/pyporting ------------------------- 1 items passed all tests: 2 tests in default 2 tests in 1 items. 2 passed and 0 failed. Test passed. Doctest summary =============== 1954 tests 559 failures in tests 0 failures in setup code 0 failures in cleanup code