Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This is an extensively large PR that adds, readjusts and consolidates tests covering most functions and methods in
commandsCore.py
,converters.py
, andcore.py
.Notes
Minor adjustments are made to:
commandsCore.py
so that onlydatetime.date
needs to be imported.converters.py
to rely ondatetime.date
only.The new file
conftest.py
contains multiple Pytest fixtures to be used by a large number of tests. Some fixtures here are made to patch specific attributes of Red and the Birthday cog to simulate the cog as close to production as possible. Locale setup is also done as an auto-use" fixture in this file, which reduces the locale boilerplate code in other test files, as this cog interacts with date objects actively.testBirthday.py
is deleted in this commit. It is superseded bytestCore.py
.Some adjustments are done to
testConverters.py
to make the test compact.Note that there is an extensive use of the type hint pattern
typing.Union[mock.Mock, Type]
. This is done so that Python language servers can apply syntax highlighting instructions based on theType
, while the objects in test stay asmock.Mock
instances.