You can avoid this by simply commenting function call in script.py, which is an obvious and quick solution to avoid execution of the module which you import. But can you see, you have to uncomment function call when you want to individually test script.py.
There is also better method which is more useful. I am going to modify script.py little bit,
if __name__ == '__main__': # condition computes to TRUE only when this script is run and not otherwise.
With this you can import module without letting Python to execute, when this script is imported, and also excute the imported module individually for testing without modifying(comment or uncomment) your code.