wechaty / python-wechaty

Python Wechaty is a Conversational RPA SDK for Chatbot Makers written in Python
https://wechaty.readthedocs.io/zh_CN/latest/
Apache License 2.0
1.62k stars 234 forks source link

Generate code coverage and add testcase. #291

Closed helloocc closed 2 years ago

helloocc commented 2 years ago
>>> pytest

============================= test session starts ==============================
platform linux -- Python 3.8.10, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /home/helloc/python-wechaty, configfile: pyproject.toml, testpaths: tests
plugins: metadata-1.11.0, asyncio-0.16.0, cov-3.0.0
collected 31 items

tests/accessory_test.py .........                                        [ 29%]
tests/config_test.py ..                                                  [ 35%]
tests/smoke_testing_test.py .                                            [ 38%]
tests/test_room.py .........                                             [ 67%]
tests/test_utils.py .                                                    [ 70%]
tests/timestamp_test.py ..                                               [ 77%]
tests/user_message_test.py ......                                        [ 96%]
tests/version_test.py .                                                  [100%]

---------- coverage: platform linux, python 3.8.10-final-0 -----------
Name                                   Stmts   Miss  Cover   Missing
--------------------------------------------------------------------
src/wechaty/__init__.py                   10      0   100%
src/wechaty/accessory.py                  58      5    91%   41, 61, 90, 118, 125
src/wechaty/config.py                     36     17    53%   62-63, 82-88, 107-126, 141-143
src/wechaty/exceptions.py                 15      5    67%   29-33, 36
src/wechaty/plugin.py                    255    183    28%   56-59, 78-104, 129-133, 141, 156-160, 167, 262-264, 298-299, 306-307, 312-336, 340-343, 349-350, 354-359, 363-365, 369-370, 378-384, 390-419, 432-615
src/wechaty/types.py                      11      3    73%   32, 50, 62
src/wechaty/user/__init__.py              13      0   100%
src/wechaty/user/contact.py              193    127    34%   58-62, 87, 112-154, 187-192, 225-239, 253-257, 264, 267, 270-273, 282-329, 337, 346-364, 372-374, 382-384, 390-392, 398-400, 406-408, 414-416, 422-424, 430-432, 438-440, 446-450, 456, 462, 468-470
src/wechaty/user/contact_self.py          38     24    37%   21-29, 36-45, 52, 56-61, 69-74
src/wechaty/user/favorite.py              16      6    62%   31, 42, 49-50, 57, 64
src/wechaty/user/friendship.py            86     57    34%   42, 62-66, 75, 87-94, 101-102, 111-115, 121-123, 130-132, 140-141, 147-164, 173-180, 186-193, 200-201, 211-222
src/wechaty/user/image.py                 28     15    46%   46, 55-58, 68-69, 76-79, 86-89, 96-99
src/wechaty/user/message.py              245    137    44%   90, 101-113, 128-177, 213, 216, 266-269, 278-281, 302-306, 314, 320-340, 346-348, 369-373, 401, 441-449, 457, 462-463, 468-469, 477-496, 508-512, 519, 532-544, 552-558, 567-578, 585-596, 603-615
src/wechaty/user/mini_program.py          54     23    57%   31, 46-49, 57-63, 70-75, 81-83, 91, 99, 106, 114, 122, 130, 138, 146
src/wechaty/user/room.py                 255    149    42%   54-57, 81, 87, 94-117, 137, 142-157, 204, 262-267, 277, 286, 310-367, 383-387, 393-399, 405-407, 422-451, 460-468, 480-482, 494, 501, 508-511, 519-559, 570-575, 586, 595-598
src/wechaty/user/room_invitation.py       84     58    31%   45-48, 53-55, 61-65, 82-85, 91-106, 112-116, 122-125, 131-134, 140-153, 159-163, 169-174, 183-198, 205-209
src/wechaty/user/tag.py                   51     32    37%   22-23, 41-44, 51-56, 63-64, 72-81, 89-96, 109-121
src/wechaty/user/url_link.py              49     30    39%   30, 40-60, 67, 75-77, 85-87, 95-97, 105-107
src/wechaty/utils/__init__.py              4      0   100%
src/wechaty/utils/async_helper.py         10      0   100%
src/wechaty/utils/date_util.py             6      0   100%
src/wechaty/utils/qr_code.py              27     22    19%   17-42
src/wechaty/utils/qrcode_terminal.py      29     29     0%   1-44
src/wechaty/utils/type_check.py            9      6    33%   17-19, 23-25
src/wechaty/version.py                     1      0   100%
src/wechaty/wechaty.py                   308    204    34%   142, 144, 189, 200, 205-225, 230, 239-245, 251-257, 262-264, 273-275, 285-288, 388-420, 424-426, 433-691, 697, 724-729, 736-738, 745
--------------------------------------------------------------------
TOTAL                                   1891   1132    40%

============================== 31 passed in 0.24s ==============================
CLAassistant commented 2 years ago

CLA assistant check
All committers have signed the CLA.

helloocc commented 2 years ago

@wj-Mcat @huan Do you have time to review this pr?

wj-Mcat commented 2 years ago

CODECOV_TOKEN is added into the environment variables.

helloocc commented 2 years ago

CODECOV_TOKEN is added into the environment variables.

No need to add cov token for public repo.

helloocc commented 2 years ago

ping @wj-Mcat

codecov[bot] commented 2 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@bdaa5bd). Click here to learn what that means. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #291   +/-   ##
=========================================
  Coverage          ?   40.14%           
=========================================
  Files             ?       26           
  Lines             ?     1888           
  Branches          ?        0           
=========================================
  Hits              ?      758           
  Misses            ?     1130           
  Partials          ?        0           
Flag Coverage Δ
unittests 40.14% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

wj-Mcat commented 2 years ago

Wechaty Contributors Nomination

Link to https://github.com/wechaty/PMC/issues/16

huan commented 2 years ago

Thank you very much for your contribution!

You are welcome to join Wechaty Contributor Program

1. Join Wechaty Organization

You've invited helloc to Wechaty! They'll be receiving an email shortly. They can also visit https://github.com/wechaty to accept the invitation.

I have invited you to join our Wechaty GitHub Organization, please accept it by following the above message. (See also: wechaty/PMC#16)

2. Update Your Wechaty Contributor Profile

  1. Please open Contributor Hall of Fame and add yourself to the end of the list, so that other contributors will know you better!
  2. Please add yourself to our Website Contributors by creating a PR and refer to this PR link as well.

3. Join The Contributor Only WeChat Room

We also have a WeChat room for contributors only which can discuss Wechaty at a deeper level, you are welcome to join and if you are interested.

Please add @lijiarui wechat: _ruirui0914 and send her this pr link. She will invite you into Wechaty Contributor Room

Cheers!