aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Joseph <[email protected]>2020-02-02 22:27:27 +0000
committerGravatar GitHub <[email protected]>2020-02-02 22:27:27 +0000
commit7aa1098b73f856288c177924c3720978f831d132 (patch)
tree600ce6b39a0dbb37baa771b536230f35d1920f8d
parentMake RuleTest use ABCMeta (diff)
parentUpdate CODEOWNERS (diff)
Merge branch 'master' into unittest-antispam-rules
-rw-r--r--.github/CODEOWNERS1
-rw-r--r--config-default.yml1
-rw-r--r--tests/README.md9
3 files changed, 10 insertions, 1 deletions
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
new file mode 100644
index 000000000..cf5f1590d
--- /dev/null
+++ b/.github/CODEOWNERS
@@ -0,0 +1 @@
+* @python-discord/core-developers
diff --git a/config-default.yml b/config-default.yml
index f842cf606..1a8aaedae 100644
--- a/config-default.yml
+++ b/config-default.yml
@@ -389,6 +389,7 @@ anti_malware:
- '.mp3'
- '.wav'
- '.ogg'
+ - '.md'
reddit:
diff --git a/tests/README.md b/tests/README.md
index d052de2f6..be78821bf 100644
--- a/tests/README.md
+++ b/tests/README.md
@@ -2,7 +2,7 @@
Our bot is one of the most important tools we have for running our community. As we don't want that tool break, we decided that we wanted to write unit tests for it. We hope that in the future, we'll have a 100% test coverage for the bot. This guide will help you get started with writing the tests needed to achieve that.
-_**Note:** This is a practical guide to getting started with writing tests for our bot, not a general introduction to writing unit tests in Python. If you're looking for a more general introduction, you may like Corey Schafer's [Python Tutorial: Unit Testing Your Code with the unittest Module](https://www.youtube.com/watch?v=6tNS--WetLI) or Ned Batchelder's PyCon talk [Getting Started Testing](https://www.youtube.com/watch?v=FxSsnHeWQBY)._
+_**Note:** This is a practical guide to getting started with writing tests for our bot, not a general introduction to writing unit tests in Python. If you're looking for a more general introduction, you can take a look at the [Additional resources](#additional-resources) section at the bottom of this page._
## Tools
@@ -212,3 +212,10 @@ All in all, it's not only important to consider if all statements or branches we
Another restriction of unit testing is that it tests, well, in units. Even if we can guarantee that the units work as they should independently, we have no guarantee that they will actually work well together. Even more, while the mocking described above gives us a lot of flexibility in factoring out external code, we are work under the implicit assumption that we fully understand those external parts and utilize it correctly. What if our mocked `Context` object works with a `send` method, but `discord.py` has changed it to a `send_message` method in a recent update? It could mean our tests are passing, but the code it's testing still doesn't work in production.
The answer to this is that we also need to make sure that the individual parts come together into a working application. In addition, we will also need to make sure that the application communicates correctly with external applications. Since we currently have no automated integration tests or functional tests, that means **it's still very important to fire up the bot and test the code you've written manually** in addition to the unit tests you've written.
+
+## Additional resources
+
+* [Ned Batchelder's PyCon talk: Getting Started Testing](https://www.youtube.com/watch?v=FxSsnHeWQBY)
+* [Corey Schafer video about unittest](https://youtu.be/6tNS--WetLI)
+* [RealPython tutorial on unittest testing](https://realpython.com/python-testing/)
+* [RealPython tutorial on mocking](https://realpython.com/python-mock-library/)