How to Solve NameError: name 'approx' is not defined -- pytest

Solution: Import the 'approx' module

To Solve the error, add the following line to the top of your code.

from pytest import approx

 

For more information:
Python pytest approx