Skip to content

More unit tests #305

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

Merged
merged 18 commits into from
May 31, 2019
Merged

More unit tests #305

merged 18 commits into from
May 31, 2019

Conversation

murrayrm
Copy link
Member

@murrayrm murrayrm commented May 26, 2019

This PR adds a bunch of unit tests based on analysis of the coverage maps from coveralls.io. There are also some small fixes in the code for uncovered bugs and other small fixes:

  • Added a reset_defaults function in config.py to allow configuration parameters to be reset to their initial values (used in unit testing).

  • Changed the exceptions in exceptions.py to derive from appropriate exception types instead of the base Exception class. Not really used, but seemed like a better way to allow people to catch exceptions using existing Python exception types.

  • Small fixes in documentation as I found some inconsistencies.

A few things that aren't addressed:

  • Unit tests for some of the plotting functions (including grid.py) are still low. These are tricky to capture in good unit tests, so I left them alone.

  • There are lots of exceptions that are used for catching bad inputs. I started writing unit tests to cover those, but since they aren't functional code, I decided it wasn't critical.

These changes brought the coverage up to about 80% in my version. Will try to set that as a target going forward.

@coveralls
Copy link

Coverage Status

Coverage increased (+2.7%) to 80.906% when pulling de52193 on murrayrm:more_unit_tests into 7188a9c on python-control:master.

@murrayrm murrayrm mentioned this pull request May 27, 2019
@murrayrm murrayrm merged commit c596a12 into python-control:master May 31, 2019
@murrayrm murrayrm deleted the more_unit_tests branch May 31, 2019 15:58
@murrayrm murrayrm added this to the 0.8.3 milestone Jan 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants