What errors / typos are supported in Python?

What errors / typos are supported in Python?

Not alternating spellings, such as is_dirvs isdir, not colorvs colour, but actual misspelled aliases, such as propretyfor property(which is not supported).

+4
source share
1 answer

Starting with Python 3.5 beta 3, the unittest.mock object now supports assretfor assert- note that this is not a keyword assert, but any attribute of a mock object that matches a regular expression assert.*or assret.*.

Some explanation:

Mock, : assert_called_with, assert_called_once_with, assert_any_call, assert_has_calls, assert_not_called, .

, , , assert_called, , , mock , mock, , , .

Mock AttributeError, - assert.

assert, Mock AttributeError, - assret.

( assert assret), unsafe=True Mock.

+8

Source: https://habr.com/ru/post/1598934/


All Articles