Shimul-Baidya / MBDyn

GNU General Public License v2.0
1 stars 1 forks source link

Make validation tests more independent from specific library #4

Open Maarrk opened 4 days ago

Maarrk commented 4 days ago

I'd like to ask for two changes:

  1. Don't check for the specific pydantic error, we just want to fail it in some way. I hope to add some validation logic directly in _EntityBasePlaceholder some day.

  2. Skip if pydantic is unavailable, so when user runs the tests without this optional dependency we communicate "you can continue without it, but you'll miss some features"

Example of where I found it (not sure if it's the only place) https://github.com/Shimul-Baidya/MBDyn/blob/80f359c36febf36195c5d767f7db161aa880a14e/contrib/PythonPreprocessor/test_MBDynLib.py#L166-L167

Example of how I wrote a similar test: https://github.com/Shimul-Baidya/MBDyn/blob/80f359c36febf36195c5d767f7db161aa880a14e/contrib/PythonPreprocessor/test_MBDynLib.py#L51-L53