diff options
author | 2019-11-13 11:24:58 +0100 | |
---|---|---|
committer | 2019-11-13 17:17:13 +0100 | |
commit | 36e9de480dcabb3c844090a4fd87561534536c04 (patch) | |
tree | 24275fba0b0be3729c74c97f6617efa62b34d1a9 /tests/base.py | |
parent | Allow `name` attribute to be set during Mock init (diff) |
Prevent setting unknown attributes on d.py mocks
Our custom `discord.py` now follow the specifications of the object
they are mocking more strictly by using the `spec_set` instead of the
`spec` kwarg to initialize the specifications. This means that trying
to set an attribute that does not follow the specifications will now
also result in an `AttributeError`.
To make sure we are not trying to set illegal attributes during the
default initialization of the mock objects, I've changed the way we
handle default values of parameters. This does introduce a breaking
change: Instead of passing a `suffix_id`, the `id` attribute should
now be passed using the exact name. `id`.
This commit also makes sure existing tests follow this change.
Diffstat (limited to 'tests/base.py')
0 files changed, 0 insertions, 0 deletions