Sp.result not working

I see the following example of contract Testing contracts | SmartPy but it doesn’t work at SmartPy
Especially I’m interesting in sp.result, but I have
sp.result is undefined or wrong number of arguments

sp.result is now replaced by return.

Here is an example:

import smartpy as sp

def main():
    class C(sp.Contract):
        def __init__(self):
            self.data.x = 10

        def set_x(self, x):
            self.data.x = x

        def get_x(self):
            return self.data.x

def test():
    s = sp.test_scenario(main)
    c = main.C()
    s += c
    s.verify(c.get_x() == 10)
    s.verify(c.get_x() == 42)

Notice that return can only be used in views. Have a look here for alternatives: Returning a value from an entrypoint