Pytest import app from app

How can I access the app variable from when running pytest?

On the Dash Testing page it gives an example where functions are imported from and another example where a new app is created within the test function:

def test_001_child_with_0(dash_duo):
    app = dash.Dash(__name__)
    app.layout = html.Div(id="nully-wrapper", children=0)

But how can I get the app variable set in If I try to run it this:

from app import app

def test_001_child_with_0(dash_duo):

…then I get ImportError: cannot import name 'app' from 'app'.

I would think that using your app variable defined in would be a common use case for writing tests so you can actually test the app you built. Or do I have to recreate the app within each test I write, copying the definition from, each time I want to access it? This seems a little redundant. Is there a better way? :confused: