multimeric / PandasSchema

A validation library for Pandas data frames using user-friendly schemas
https://multimeric.github.io/PandasSchema/
GNU General Public License v3.0
189 stars 35 forks source link

Fixed wrong Exception Inheritance #60

Open Swanand01 opened 3 years ago

Swanand01 commented 3 years ago

Hi @multimeric, I'm actually new to the open source community and Github in general. I haven't created any tests yet, so it would be great if you could actually guide me and tell me what exactly is to be done. Thanks.

multimeric commented 3 years ago

To test that this has fixed the issue in question (#54), you need to recreate a situation where PandasSchema throws an error, and then assert that the error's class is no longer a subclass of BaseException. Ideally you will also test the downstream implication of this: namely that it can be caught by except Exception.

PandasSchema uses Python's built-in unittest module for testing. You can learn about that if you aren't familiar with it. In this case, you will probably need to create a new test_exceptions.py file since this test doesn't fit into any of the existing test categories. In that file you will create a new class with a new test function that performs the assertion described above. When in doubt, follow what the other tests have done.