Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No testing #89

Open
Laura7089 opened this issue Jun 1, 2021 · 3 comments
Open

No testing #89

Laura7089 opened this issue Jun 1, 2021 · 3 comments
Labels
enhancement New feature or request question Further information is requested tests Related to the project testing

Comments

@Laura7089
Copy link
Member

As of right now, there are no tests whatsoever in the repo. This is mostly down to the fact that our primary IO - discord.py is difficult to test against since it provides no test suite (that we know of). Additionally, we make a lot of calls to google, twitch and twitter APIs which are in turn difficult to test against.

However, we have several areas of functionality which actually don't call any of the above and so can likely be unit tested well. Plus, there are ways of testing the functionality of IO-heavy operations; for example, mocks or snapshot testing.

@Laura7089 Laura7089 added enhancement New feature or request tests Related to the project testing labels Jun 1, 2021
@Laura7089
Copy link
Member Author

Laura7089 commented Jun 1, 2021

Python provides built-in support for testing with

We could create a tests directory in the root with a mirrored module layout, then insert tests into that as we write them.
Or, we could put tests in the source directory alongside the code they're testing, in files like test_strTyping.py for easy import management.

Then, a simple python -m unittest discover src or python -m unittest discover tests would run them all and report the results.

@Laura7089
Copy link
Member Author

Linking to #85, this could then also be added to CI which could in turn block PRs until tests pass. We could also add a minimum test coverage barrier (if we really hate ourselves).

@Laura7089 Laura7089 added the question Further information is requested label Jun 1, 2021
@Laura7089
Copy link
Member Author

A testing library for discord.py exists at https://pypi.org/project/dpytest/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested tests Related to the project testing
Projects
None yet
Development

No branches or pull requests

1 participant