Azure-Samples / azure-flask-postgres-flexible-aca

Web app using Python Flask backend, set up for deployment to Azure Container Apps with Azure PostgreSQL Flexible server.
MIT License
3 stars 5 forks source link

Failed to run tests with flask templates on Windows and Mac #7

Open v-jiaodi opened 1 year ago

v-jiaodi commented 1 year ago

Describe the issue: When test Running tests with flask templates on Windows and Mac, run python3 -m pytest, get error as follow: image

Repro Steps:

  1. Clone the repo to local.
  2. Create a Python virtual environment and activate it.
  3. Install requirements: python3 -m pip install -r requirements-dev.in playwright install --with-deps
  4. Run the tests: python3 -m pytest

Environment:

Expected behavior: Running python3 -m pytest with flask templates can pass on Windows and Mac

@pamelafox for notification.

pamelafox commented 1 year ago

cc @kjaymiller I think we need to ditch pytest-flask given all the issues (and no 3.12 compat) and roll own. The pickle issue is discussed here: https://github.com/pytest-dev/pytest-flask/issues/54

kjaymiller commented 11 months ago

We ditched pytest-flask in a recent update to the source.

I'll be updating the repos (sadly it's gonna be a manual job).

I'll check back in with later today.

pamelafox commented 11 months ago

@v-jiaodi Can you see if you are still having issues? We completely changed our local testing approach for Flask and I'm hopeful it'll now work on Windows.

kjaymiller commented 11 months ago

@pamelafox as I read this, did you mean that it WILL work on Windows?

pamelafox commented 11 months ago

Sorry, typo, it was meant to say "now work on Windows", not "not work on Windows". Thanks for clarifying Jay!

v-jiaodi commented 11 months ago

@v-jiaodi Can you see if you are still having issues? We completely changed our local testing approach for Flask and I'm hopeful it'll now work on Windows.

@pamelafox Test again, this issue still exists.

pamelafox commented 11 months ago

Can you share the exact error? It should be different since we changed testing package.

v-jiaodi commented 11 months ago

Error log as follow: image

pamelafox commented 11 months ago

Great, thank you, I am working on a fix.

pamelafox commented 11 months ago

@v-jiaodi I have pushed a fix that should hopefully help for Windows, could you pull again and try?

v-jiaodi commented 11 months ago

@pamelafox Test again, the error message is as follows: image