| Commit message (Collapse) | Author | Age | Lines |
|
|
|
|
|
|
| |
This commit replaces the standard MagicMocks by our specialized mocks
for discord.py objects. It also adds the missing `channel` attribute
to the `tests.helpers.MockMessage` mock and moves the file to the
correct folder.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit introduces some new Mock-types to the already existing
Mock-types for discord.py objects. The total list is now:
- MockGuild
- MockRole
- MockMember
- MockBot
- MockContext
- MockTextChannel
- MockMessage
In addition, I've added all coroutines in the documentation for these
discord.py objects as `AsyncMock` attributes to ease testing. Tests
ensure that the attributes set for the Mocks exist for the actual
discord.py objects as well.
|
|
|
|
|
|
|
|
|
| |
I have change the testrunner from `unittest` to `xmlrunner` in the
Azure pipeline to be able to publish our test results on Azure. This
is the same runner as `site` uses to generate XML reports.
In addition, I've cleaned up some small mistakes in docstrings and
`README.md`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After a discussion in the core developers channel, we have decided to
migrate from `pytest` to `unittest` as the testing framework. This
commit sets up the repository to use `unittest` and migrates the
first couple of tests files to the new framework.
What I have done to migrate to `unitest`:
- Removed all `pytest` test files, since they are incompatible.
- Removed `pytest`-related dependencies from the Pipfile.
- Added `coverage.py` to the Pipfile dev-packages and relocked.
- Added convenience scripts to Pipfile for running the test suite.
- Adjust to `azure-pipelines.yml` to use `coverage.py` and `unittest`.
- Migrated four test files from `pytest` to `unittest` format.
In addition, I've added five helper Mock subclasses in `helpers.py`
and created a `TestCase` subclass in `base.py` to add an assertion
that asserts that no log records were logged within the context of
the context manager. Obviously, these new utility functions and
classes are fully tested in their respective `test_` files.
Finally, I've started with an introductory guide for writing tests
for our bot in `README.md`.
|
| |
|
| |
|
|
|