Setting up an environment for testing modules locally

This is how what I see in PyCharm with the app I’m working on now, following the suggestions from Ian:

image

And this is how I import some modules:

if anvil.server.context.type == 'uplink':
    # running tests on pc
    from client_code.Release import Project
    def execute_query_and_fetchall(cmd, parameters=None):
        return anvil.server.call('execute_query_and_fetchall', cmd, parameters)
else:
    # running on Anvil server
    from Release import Project
    from Sql import execute_query_and_fetchall

The imports are different because I only have access to SQL from the server, not from uplink and because… it works.

1 Like