-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement testing such that it runs in VS Code and can be run in CI #25
Comments
Am able to execute Executing in the VS Code UI (the Erlenmeyer flask icon) I get all kinds of errors:
|
With #26 the problems above are fixed. |
Running
We need to bring |
Reading some posts and docs:
I think I can achieve complete models.py test coverage by using the django rest framework to exercise CRUD operations on every model class. Though this tutorial uses Django's UnitTest (rather that pytest) it looks like a useful resource: https://realpython.com/test-driven-development-of-a-django-restful-api/ I also need a test for the home "overview first" view that's been implemented. Another doc: https://blog.logrocket.com/django-rest-framework-build-an-api-in-15-minutes/ |
With #26 tests are working now in VS Code: |
Adding one model class (Person) to the test requires modifying quite a few files:
I suppose this is the consequence of a deeply object oriented architecture. |
Test coverage is a little better:
Still not 100%, but framework is in place to add more tests and get CI working. |
Closing this Issue and staring new ones for follow-on work. |
Can't get testing to work in VS Code on my desktop. Getting these kind of errors:
It's like somehow the proper settings aren't being used by VS Code on my desktop. Executing May be related to the Issue discussed here: microsoft/vscode-python#8678 |
Note that this problem cropped up after the container's /app context was changed from ./smdb to ./ as part of #33, in particular this commit. Everything still works with pytest on the command line and in CI, it's just the VS Code execution that's broken. |
Now on my laptop when trying to run test in debug mode I get this error:
It seems that there are one too many |
[requires.io] dependency update on main branch
Tests in VS Code still failing:
Maybe this milestone will fix it: microsoft/vscode-python#17242 |
Following directions at https://djangostars.com/blog/django-pytest-testing/.
The text was updated successfully, but these errors were encountered: