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

Write tests for __main__.py #54

Closed
KevinHock opened this issue Jun 30, 2017 · 9 comments
Closed

Write tests for __main__.py #54

KevinHock opened this issue Jun 30, 2017 · 9 comments

Comments

@KevinHock
Copy link
Collaborator

As we can see on CodeClimate https://codeclimate.com/github/python-security/pyt/coverage/5935971dbf92ed000102998b there is pretty low test coverage of main, I understand why this is but adding some tests for it would increase our test coverage percentage and 75% isn't satisfying.

If you have any trouble with this I can help, I am going to label this issue as Easy so new comers see it.

@KevinHock KevinHock added the easy label Jun 30, 2017
@yongzx
Copy link

yongzx commented Jul 11, 2017

@KevinHock, can I contribute to solving this issue? (I am still a beginner in OS.)

@KevinHock
Copy link
Collaborator Author

Sure @yongzx, I can try to write the first test to give you a better idea of what I had in mind, I'll write it sometime today, push it to a branch, and let you know. Apologies for not doing this initially.

@yongzx
Copy link

yongzx commented Jul 11, 2017

Thanks! It's alright, I was just intending to ask you about the test you had in mind.

@KevinHock
Copy link
Collaborator Author

KevinHock commented Jul 12, 2017

Hmm, so https://github.com/python-security/pyt/compare/54_tests_for_main is a test for what happens when we pass no args to the program. There is a problem though, if we look at __main__.py from https://codeclimate.com/github/python-security/pyt/coverage, the main() function is what we want more coverage on, so this is only a step closer to running main().

@KevinHock
Copy link
Collaborator Author

(Merged it so it's just easier than 2 people contributing to one branch.) I think the next step is to call main with random args (e.g. Print def use graph to a file) and make tests that verify it does what it currently does. Let me know if you'd like me to write the first of one of these.

@yongzx
Copy link

yongzx commented Jul 13, 2017

I will give it a try first. Thanks for the clarification.

@yongzx
Copy link

yongzx commented Jul 15, 2017

Just understood the codes in __main__.py and how the tests files go together. Will start writing a test for __main__.py.

@KevinHock
Copy link
Collaborator Author

Sounds good, thanks. Feel free to take your time, let me know if you need any help.

@KevinHock
Copy link
Collaborator Author

I did this in another branch already, gonna merge in a week or two, but I figured I would close this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants