Title: Refactor the test suite using pytest for array and matrix types by bnavigator · Pull Request #438 · python-control/python-control · GitHub
Open Graph Title: Refactor the test suite using pytest for array and matrix types by bnavigator · Pull Request #438 · python-control/python-control
X Title: Refactor the test suite using pytest for array and matrix types by bnavigator · Pull Request #438 · python-control/python-control
Description: Inspired by the discussion in #433 I created a pytest fixture matarrayout that parametrizes all the test functions and runs them both with use_numpy_matrix(True) and ...(False) for the two available output conventions. To turn on the autouse fixture, export the environment variable PYTHON_CONTROL_ARRAY_AND_MATRIX=1. There is an additional Travis CI job for this. It turned out, that the unittest.TestCase inheriting test classes don't like using the autoused fixture. So one thing let to the other and I converted all the test files to conform to pytest. Test suite changes There are several tests that use config.reset_defaults() working against the functionality of the new fixture. So I changed that too and created the fixture editsdefaults. BTW, I think defaults is a misnomer. It should be settings that can be reset to default values. robust_array_test.py is removed and its functionality completely replaced by the usage of matarrayin in robust_test.py statefbk_array_test.py and state_fbk_matrix_test.py are merged into statefbk_test.py with matarrayin. statesp_array_test.py is merged into statesp_test.py timeresp_test.py looks completeley different now. The tests are organized more systematically to test the time response functions with a more complete set of parameter variations. This revealed the issue described in #442. xferfcn_test.py::test_matrix_multiply() now checks both left and right multiplication with np.matrix and is prepared for array matmul, if we ever succeed to implement it (currently xfails for array). the Travis CI test matrix is extended to Python 3.8 and the matrix definition is cleaned up. There are a few new named pytest marks importable from control.tests.conftest which can be used as decorators on tests for easier definition of skips: @slycotonly @nopython2 @noscipy0 The matarrayout fixture updates the warnings filter for numpy matrix deprecation warnings. No global filter anymore, so unexpected usage gets revealed for matarrayout=np.array. For checking that functions work with matrix or arrays as input, you can use the fixture matarrayin. The new statefbk_test.py makes use of this -- No test code should directly use deprecated np.matrix anymore.
Open Graph Description: Inspired by the discussion in #433 I created a pytest fixture matarrayout that parametrizes all the test functions and runs them both with use_numpy_matrix(True) and ...(False) for the two availabl...
X Description: Inspired by the discussion in #433 I created a pytest fixture matarrayout that parametrizes all the test functions and runs them both with use_numpy_matrix(True) and ...(False) for the two availabl...
Opengraph URL: https://github.com/python-control/python-control/pull/438
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:e995f098-fbdc-a2bd-de3d-43da19cbe492 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | CF98:28EB67:339D18:4531E7:697AF401 |
| html-safe-nonce | 7edd1aabbf1457d0a0929f2da4946028961e6b970ab4c6516e5853cbd9f99eea |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRjk4OjI4RUI2NzozMzlEMTg6NDUzMUU3OjY5N0FGNDAxIiwidmlzaXRvcl9pZCI6IjIyMjczMDg0MDAxMDQ2MzMzNDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 2833f96dbb5fe3c39ca836b7a52961c50d83285ab2d36b364cb6e9c4adc8362d |
| hovercard-subject-tag | pull_request:456673862 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python-control/python-control/pull/438/checks |
| twitter:image | https://avatars.githubusercontent.com/u/4623504?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/4623504?s=400&v=4 |
| og:image:alt | Inspired by the discussion in #433 I created a pytest fixture matarrayout that parametrizes all the test functions and runs them both with use_numpy_matrix(True) and ...(False) for the two availabl... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7ce8ed0a54c4730aeca4e6abacfc6490365fc42e25480b86883054df3f9181c8 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-control/python-control git https://github.com/python-control/python-control.git |
| octolytics-dimension-user_id | 2285872 |
| octolytics-dimension-user_login | python-control |
| octolytics-dimension-repository_id | 22791752 |
| octolytics-dimension-repository_nwo | python-control/python-control |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 22791752 |
| octolytics-dimension-repository_network_root_nwo | python-control/python-control |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d7bfc78137af9a4828305e52ab993fce981d7085 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width