The issue was a typo, thanks everyone who tried to help
I'm trying to run a unit test in travis-ci. At one point I have a class which simplified looks like this:
class X:
def __init__(self, var1):
self.var1 = var1
def Y(self):
return True
def Z(self):
return False
def call_function(self, function):
output = function(self.Y, self.Z, self.var1)
I then call X.call_function
, which has given me no problems in the past when running the program. However, when running this in travis-ci I'm told:
'X' object has no attribute 'Y'
Strangely enough, it does not appear to have an issue with self.Z
.
Does anybody know what causes this and how to fix it?
Update:
For clarity, the function
parameter would be something like:
def function(func1, func2, var1):
if type(var1) == int:
func1()
else:
func2()
And then the main file would be something like:
x = X(3)
x.call_function(function)