aboutsummaryrefslogtreecommitdiffstats
path: root/tests/base.py (follow)
Commit message (Collapse)AuthorAgeLines
* Merge branch 'main' into discord-2.0Gravatar Matteo Bertucci2021-10-15-1/+2
|\
| * Migrate to `bot.log.get_logger` functionGravatar Izan2021-10-14-1/+2
| |
* | Migrate to Discord.py 2.0a0Gravatar Matteo Bertucci2021-09-06-1/+1
|/ | | | | | | | Since the Discord.py repository has been archived, we can switch to the latest commit of 2.0a0, knowing no breaking change will occur (still pinned to the commit just in case). This commits fixes any problem related to the migration: - New avatar interface - TZ aware datetimes - Various inernal API changes
* Update code for pep8-naming complianceGravatar S. Co12020-03-03-2/+2
|
* Migrate syncers test suite to Python 3.8Gravatar Sebastiaan Zeeff2020-02-24-2/+2
| | | | The test suite for the new role/member syncers used the "old"-style test suite with the helpers implemented for Python 3.7. I have migrated it to use the new Python 3.8 asyncio test helpers.
* Merge branch 'master' into python38-migrationGravatar Sebastiaan Zeeff2020-02-24-0/+34
|\
| * Tests: create TestCase subclass with a permissions check assertionGravatar MarkKoz2020-02-12-0/+34
| | | | | | | | | | | | The subclass will contain assertions that are useful for testing Discord commands. The currently included assertion tests that a command will raise a MissingPermissions exception if the author lacks permissions.
* | Use mixin-composition not inheritance for LoggingTestCaseGravatar Sebastiaan Zeeff2020-02-23-3/+7
|/ | | | | | We used inheritence to add additional logging assertion methods to unittest's TestCase class. However, with the introduction of the new IsolatedAsyncioTestCase this extension strategy means we'd have to create multiple child classes to be able to use the extended functionality in all of the TestCase variants. Since that leads to undesirable code reuse and an inheritance relationship is not at all needed, I've switched to a mixin-composition based approach that allows the user to extend the functionality of any TestCase variant with a mixin where needed.
* Add tests for tests.baseGravatar Sebastiaan Zeeff2019-10-11-3/+0
| | | | | | | | | | | I forgot to test some aspects of the `tests.base` module, including some branches of the `self.assertNotLogs` method. I've corrected that by including a couple of tests. I also removed the test result publishing from the Azure pipeline, since I've not configured an XML test runner yet. The coverage report is still published, of course and test output will be available in standard out, so information is readily available.
* Migrate pytest to unittestGravatar Sebastiaan Zeeff2019-10-11-0/+70
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`.