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

Add tests for progress_bar #2127

Closed
wants to merge 2 commits into from

Conversation

HarshKhilawala
Copy link
Contributor

@HarshKhilawala HarshKhilawala commented Mar 18, 2023

Checklist
Thank you for contributing to QuTiP! Please make sure you have finished the following tasks before opening the PR.

  • Please read Contributing to QuTiP Development
  • Contributions to qutip should follow the pep8 style.
    You can use pycodestyle to check your code automatically
  • Please add tests to cover your changes if applicable.
  • If the behavior of the code has changed or new feature has been added, please also update the documentation in the doc folder, and the notebook. Feel free to ask if you are not sure.
  • Include the changelog in a file named: doc/changes/<PR number>.<type> 'type' can be one of the following: feature, bugfix, doc, removal, misc, or deprecation (see here for more information).

Description
Add tests for ui.progressbar

@HarshKhilawala
Copy link
Contributor Author

@Ericgig Can you please guide me through (step-by-step developing test function or test classes) writing tests for progressbar? I don't have much experience with writing python tests? But I am a quick learner and can easily grasp the fundamentals.

@coveralls
Copy link

coveralls commented Mar 18, 2023

Coverage Status

Coverage: 75.391%. Remained the same when pulling a25e4d4 on HarshKhilawala:test-progressbar into 41129bc on qutip:master.

@Ericgig
Copy link
Member

Ericgig commented Mar 21, 2023

You simple need to create a function starting with test_ that use the progress bar. Ideally you would use it in a way that ensure all lines of code are used at least once. Then if there is an error in the code, python will raise an error and the test will fail.

There should be some tutorials for pytest on the web, writing a step per step guide on making tests is more work than making the tests themselves so please have mercy.

@HarshKhilawala
Copy link
Contributor Author

@Ericgig Thanks for getting back to me. I will refer to pytest tutorials on web but I found some code lines like following:

@pytest.mark.parametrize
@check_pngs_equal
@pytest.fixture
@pytest.mark.repeat(10)...

Can you please let me know when and why were these used? Is there a resource also for this one?

@ajgpitch
Copy link
Member

ajgpitch commented Mar 21, 2023 via email

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

Successfully merging this pull request may close these issues.

None yet

4 participants