Skip to content

Commit

Permalink
Fix functional tests: share flask instance across testing session (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
sea-kelp authored Aug 17, 2022
1 parent 10246e3 commit c0a9a57
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions OpenOversight/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,14 +673,17 @@ def teardown():
return client


@pytest.fixture
def browser(app, request):
@pytest.fixture(scope="session")
def server(app, request):
# start server without werkzeug auto-refresh
# https://stackoverflow.com/questions/38087283/
threading.Thread(target=app.run, daemon=True, kwargs={"debug": False}).start()
# give the server a few seconds to ensure it is up
time.sleep(10)


@pytest.fixture
def browser(app, request, server):
# start headless webdriver
vdisplay = Xvfb()
vdisplay.start()
Expand Down

0 comments on commit c0a9a57

Please sign in to comment.