athul / waka-readme

Wakatime Weekly Metrics on your Profile Readme.
https://github.com/athul
MIT License
1.56k stars 302 forks source link

Tests #10

Closed athul closed 2 years ago

athul commented 4 years ago

We may need to write tests to check it properly for any new update.

yozachar commented 4 years ago

I don't know how to... but yea I'm interested to know how to write one.

yozachar commented 4 years ago

I saw the test. But can someone please explain the concept behind it. There's a random bunch of assertions in the test_main.py file. How does that help for all the possibilities that can occur. Any pointers to good documentation?

siddharth2016 commented 4 years ago

I saw the test. But can someone please explain the concept behind it. There's a random bunch of assertions in the test_main.py file. How does that help for all the possibilities that can occur. Any pointers to good documentation?

you can check https://realpython.com/python-testing/, really helpful introduction to writing tests in python

dvjn commented 4 years ago

The current implementation of tests uses the python standard library's unit tests, I think we should implement them in a mature and widely used library like pytest which is easier to understand and focuses more on the tests rather than the boilerplate syntax.

If anyone can give me a green light ( @joe733 @athul ), I'll be more than happy to put a PR with complete tests in pytest.

Here, take a look at pytest documentation