bridge-in-tech-backend icon indicating copy to clipboard operation
bridge-in-tech-backend copied to clipboard

Dev: Unittest failed on Windows OS cmd terminal but passed on VSCode IDE

Open mtreacy002 opened this issue 4 years ago • 20 comments

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:

  1. Go to VSCode Test explorer
  2. Run all tests and see all tests passed
  3. Now run 'python -m unittest discover tests' from CMD terminal
  4. 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: unittest errors

On Mac OS: Screen Shot 2020-09-11 at 11 13 17 am

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 postgre dialect

mtreacy002 avatar Sep 11 '20 01:09 mtreacy002

@mtreacy002 is this issue available?

ashwinijha6 avatar Feb 06 '21 10:02 ashwinijha6

Yes, @ashwinijha6 it's still available. Would you like to work on it?

mtreacy002 avatar Feb 08 '21 01:02 mtreacy002

@mtreacy002 is this just for windows OS or Can I check the bug for Linux OS also?

ashwinijha6 avatar Feb 08 '21 07:02 ashwinijha6

@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?

mtreacy002 avatar Feb 09 '21 21:02 mtreacy002

@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?

ashwinijha6 avatar Feb 11 '21 15:02 ashwinijha6

Sure, @ashwinijha6 . will assign you to this now. 😉

mtreacy002 avatar Feb 16 '21 09:02 mtreacy002

@ashwinijha6 , any update on this? Have you tried running on Linux? Did you face the same issue?

mtreacy002 avatar Feb 24 '21 10:02 mtreacy002

@mtreacy002 I need a little time on this as I'm facing an issue with pgadmin4.

ashwinijha6 avatar Feb 25 '21 19:02 ashwinijha6

Sure, @ashwinijha6 . Let me know if you need help.

mtreacy002 avatar Feb 25 '21 22:02 mtreacy002

@ashwinijha6 , can you please give update on this?

mtreacy002 avatar Mar 04 '21 10:03 mtreacy002

Yes @mtreacy002 the tests fail when performing them on the terminal bit_test

ashwinijha6 avatar Mar 07 '21 18:03 ashwinijha6

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?

mtreacy002 avatar Mar 07 '21 21:03 mtreacy002

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 avatar Mar 08 '21 04:03 ashwinijha6

@ashwinijha6 , can you please give us an update on this?

mtreacy002 avatar Mar 12 '21 21:03 mtreacy002

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 sqlalchemy Could you help me with the python version that is being used for the project ? I'm using python3.7

ashwinijha6 avatar Mar 13 '21 16:03 ashwinijha6

@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.

mtreacy002 avatar Mar 13 '21 20:03 mtreacy002

@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 avatar Mar 15 '21 08:03 ashwinijha6

@ashwinijha6 any updates on this ?

Rahulm2310 avatar Mar 22 '21 18:03 Rahulm2310

@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

ashwinijha6 avatar Mar 23 '21 06:03 ashwinijha6

No issues @ashwinijha6 Thanks for giving the updates now it's open for OSH aspirants 😉.

Amulya-coder avatar Mar 24 '21 18:03 Amulya-coder