szha commented on pull request #18997: URL: https://github.com/apache/incubator-mxnet/pull/18997#issuecomment-683217771
@ekdnam yes happy to help. As documented [here](https://mxnet.apache.org/community/code_guide), mxnet uses pytest as the python testing tool for development. Here's pytest's guide on [how to write tests for expected exception](https://docs.pytest.org/en/stable/assert.html#assertions-about-expected-exceptions). With that, you can write the statements to check whether an exception (and in this case the expected error should be `MXNetError`) is raised when input argument doesn't meet the lower bound. To test this out locally, you need to: - follow the [build from source guide](https://mxnet.apache.org/get_started/build_from_source) (we use cmake for this, configs are in [/config](https://github.com/apache/incubator-mxnet/tree/master/config), choose the one that's right for your platform) and build the change locally. - cd into `/python` folder, and you can use `python setup.py develop` to link your local copy to your python site packages, which will enable your python to find the mxnet package you built. - if you haven't yet, install pytest. you may also choose to install the development and testing dependencies that are exactly the same as mxnet CI. you can achieve this with ``` python -m pip install -r https://raw.githubusercontent.com/apache/incubator-mxnet/master/ci/docker/install/requirement ``` - finally, run the test and make sure it passes. the complete test suite of mxnet is quite large so instead you may choose to run a specific test. see pytest's guide on [selecting the test to run](https://docs.pytest.org/en/stable/usage.html#specifying-tests-selecting-tests) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
