Best Python code snippet using hypothesis
array_api.py
Source:array_api.py
...783 eps: float784 max: float785 min: float786 smallest_normal: float787 def mock_finfo(dtype: DataType) -> FloatInfo:788 """Returns a finfo object compliant with the Array API789 Ensures all attributes are Python scalars and not NumPy scalars. This790 lets us ignore corner cases with how NumPy scalars operate, such as791 NumPy floats breaking our next_down() util.792 Also ensures the finfo obj has the smallest_normal attribute. NumPy only793 introduced it in v1.21.1, so we just use the equivalent tiny attribute794 to keep mocking with older versions working.795 """796 _finfo = np.finfo(dtype)797 return FloatInfo(798 int(_finfo.bits),799 float(_finfo.eps),800 float(_finfo.max),801 float(_finfo.min),...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!