I've a method that returns a list of objects that meet certain criteria
result = find_objects(some_criteria)
print("%r" % result)
>> [<my_object.my_object object at 0x85abbcc>]
I would like to write a pytest to verify the operation of find_objects()
def test_finder(testbed):
result = testbed.find_objects(some_criteria)
assert result is [<my_object.my_object object at 0x85abbcc>]
So far, pytest is pointing to the left angle-bracket (<) and declaring "SyntaxError"
I'm thinking that even if I get this to work, it will fail in the future when 'my_object' is stored in another location. If I have multiple instances, how would I confirm that the correct number of them were reported?
In this context, what is the pythonic way to verify the output of a method that returns objects?
js