I have some python code that contains unit tests like below:
class SunCalcTestCases(unittest.TestCase):
"""Tests for `suncalc.py`."""
def near(val1, val2):
return abs(val1 - val2) < (margin or 1E-15)
def test_getPositions(self):
"""Get sun positions correctly"""
sunPos = suncalc.getPosition(self.date, self.lat, self.lng)
az = sunPos["azimuth"]
res = self.near(az, -2.5003175907168385)
But when I run this I get the error:
Traceback (most recent call last):
File "test.py", line 64, in test_getPositions
res = self.near(az, -2.5003175907168385)
TypeError: near() takes exactly 2 arguments (3 given)
I am new to python so I apologize if I am missing something here, but as far as I can tell I am only passing in two parameters when I call the function: self.near(az, -2.5003175907168385)
Can anyone tell me why it thinks I'm passing in 3 parameters?