bridge-in-tech-backend
bridge-in-tech-backend copied to clipboard
Dev: Unittest failed on Windows OS cmd terminal but passed on VSCode IDE
Describe the bug
Contributors using Windows OS cmd (and perhaps Linux OS) will see tests as failed when running python -m unittest discover tests
from the CMD terminal. However the tests will pass on the VSCode IDE on Windows and Linux machines. The same tests will pass on both terminal and VSCodee IDE on a MacOS machines
To Reproduce Steps to reproduce the behavior: On Windows OS:
- Go to VSCode Test explorer
- Run all tests and see all tests passed
- Now run 'python -m unittest discover tests' from CMD terminal
- See all tests failed with error message `Can't load plugin: sqlalchemy.dialects:None
Expected behavior Running unittest from the terminal should also pass so they are consistent with successful tests on VSCode IDE
Screenshots
On Windows OS:
On Mac OS:
Desktop (please complete the following information):
- OS: Windows and Mac OS
- Browser NA (VSCode IDE)
- Version ??
Additional context
Potential cause is the sqlalchemy.dialects.postgresql did not get picked up as plugin inside CMD terrminal on Windows. I have tried running
import sqlalchemy.dialects.postgresql
from python shell to check if the plugin is within the package. If the plugin is not included it should give error, but instead the result shows that plugin for postgresql dialect already installed, just didn't get picked up when running the unittest (see the orange box showing error message on Windows screenshot above).
- screenshot running import dialect passed without error
@mtreacy002 is this issue available?
Yes, @ashwinijha6 it's still available. Would you like to work on it?
@mtreacy002 is this just for windows OS or Can I check the bug for Linux OS also?
@ashwinijha6 , I'm not sure to whether or not this also the case on Linux since I'm only testing this on Windows. What machine you're going to use to work on this issue?
@ashwinijha6 , I'm not sure to whether or not this also the case on Linux since I'm only testing this on Windows. What machine you're going to use to work on this issue?
Hey @mtreacy002 I'll be using Linux OS (Ubuntu 16.04) for trying the issue. Could u assign it to me?
Sure, @ashwinijha6 . will assign you to this now. 😉
@ashwinijha6 , any update on this? Have you tried running on Linux? Did you face the same issue?
@mtreacy002 I need a little time on this as I'm facing an issue with pgadmin4.
Sure, @ashwinijha6 . Let me know if you need help.
@ashwinijha6 , can you please give update on this?
Yes @mtreacy002 the tests fail when performing them on the terminal
Ahhh, I see. @ashwinijha6, can you please add this point in the issue description (that same issue also happens on Linux OS and please indicate your terminal shell)? Are you able to continue working on it for the fix?
Ahhh, I see. @ashwinijha6, can you please add this point in the issue description (that same issue also happens on Linux OS and please indicate your terminal shell)? Are you able to continue working on it for the fix?
Ya sure @mtreacy002 I will add it in the description. Also I will continue working on the fix 👍
@ashwinijha6 , can you please give us an update on this?
Yes @mtreacy002 I thought that it as an error due to sqlalchemy I tried installing by pip install --upgrade sqlalchemy
(screenshot attached) but while running the tests I get the same error
Could you help me with the python version that is being used for the project ? I'm using python3.7
@ashwinijha6 , I'm also using Python 3.7 (3.7.9 to be exact). Btw, I noticed the dialect being imported is sqlite. It should be psycopg2.
@ashwinijha6 , I'm also using Python 3.7 (3.7.9 to be exact). Btw, I noticed the dialect being imported is sqlite. It should be psycopg2.
ok yes I will check with that @mtreacy002
@ashwinijha6 any updates on this ?
@ashwinijha6 any updates on this ?
I'm a bit preoccupied at moment @Rahulm2310, If you want you can assign it to someone else. Sorry for the delay
No issues @ashwinijha6 Thanks for giving the updates now it's open for OSH aspirants 😉.