mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-11 03:09:31 +00:00
Add example unit test and config for testing
Add testing configuration: - pytest as test framework - tox for creating testing environments and running tests (run with `tox`) - pytest-asycio for asyncio testing - coverage/pytest-cov for measuring test coverage - flake8 for pep8 checking I've also added one quick example test demonstrating basic unit testing and use of the basic fixtures and marks provided by pytest-asyncio. Just this already covers a suprising 32% of the codebase, mostly through imports, but I wouldn't expect it to be helpful yet. This should provide a good base to build on in the future though.
This commit is contained in:
22
tox.ini
Normal file
22
tox.ini
Normal file
@@ -0,0 +1,22 @@
|
||||
[tox]
|
||||
envlist = py35,py36,py37,py38
|
||||
|
||||
[testenv]
|
||||
deps =
|
||||
-rrequirements.txt
|
||||
-roptional-requirements.txt
|
||||
-rdev-requirements.txt
|
||||
commands =
|
||||
# NOTE: you can run any command line tool here - not just tests
|
||||
pytest {posargs}
|
||||
|
||||
# run with tox -e flake
|
||||
[testenv:flake]
|
||||
deps =
|
||||
-rrequirements.txt
|
||||
-roptional-requirements.txt
|
||||
-rdev-requirements.txt
|
||||
flake8
|
||||
commands =
|
||||
# TODO: move options to dedicated flake8 config
|
||||
flake8 --exclude telethon/tl/,telethon/errors/rpcerrorlist.py --ignore E501,F401 telethon/ tests/
|
Reference in New Issue
Block a user