Python Forum
Need consultation about running tests for a Github repo
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need consultation about running tests for a Github repo
#1
Hello,
I have just cloned a Git hub repo given here
But there is something I don't quite understand.
I have opened this project using VS Code with option Open Folder, and then I navigated to the cloned folder called pyads.

I tried to run tests, specifically test_symbol.py but I was not able to, because of the Module Not Found error on this line:
Quote:from tests.test_connection_class import create_notification_struct

Somehow VS code does not see this, even though there is a tests folder in the project.
Also, I noticed that my Pylint is complaining about the fact that create_notification_struct was never used and indeed after I delete whole line, I can run this .py file from the VS Code with Ctrl+F5, and all 29 tests are OK.
Also there is a complaint that pointer is not used in the line:
Quote:from ctypes import sizeof


So my question is: Are these imports were really unnecessary, or they are needed, but I (and Pylint) don't see it where.

Thanks
Reply
#2
Quote:Hello,
I have just cloned a Git hub repo given here
But there is something I don't quite understand.
I have opened this project using VS Code with option Open Folder, and then I navigated to the cloned folder called pyads.

I tried to run tests, specifically test_symbol.py but I was not able to, because of the Module Not Found error on this line:
Quote:
from tests.test_connection_class import create_notification_struct

Somehow VS code does not see this, even though there is a tests folder in the project.
Also, I noticed that my Pylint is complaining about the fact that create_notification_struct was never used and indeed after I delete whole line, I can run this .py file from the VS Code with Ctrl+F5, and all 29 tests are OK.
Also there is a complaint that pointer is not used in the line:
Quote:
from ctypes import sizeof


So my question is: Are these imports were really unnecessary, or they are needed, but I (and Pylint) don't see it where.

Thanks
The import is likely only needed for pytest/test framework context, not for your direct run in VS Code. When you run the file with Ctrl+F5, Python doesn’t treat the project root as a package, so:
  • from tests... may fail due to import path issues
    but the test still runs if you remove unused dependencies

Pylint is flagging it correctly as unused in your current run, but it may still be used in other test setups (like pytest or CI).

User has been warned for this post. Reason: Adding spam link to quoted post
buran write Apr-29-2026, 06:12 AM:
Spam link added to quoted post has been removed
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Ran 0 tests in 0.000s - unittest Peaches 8 10,254 Dec-31-2021, 08:58 AM
Last Post: Peaches
  Unable to import Private Repo using setup.py Bob786 1 2,752 Sep-02-2021, 04:19 PM
Last Post: snippsat
  Running python scripts from github etc pacmyc 7 6,545 Mar-03-2021, 10:26 PM
Last Post: pacmyc
  VSCode not able to discover tests rpk2006 5 20,682 Jul-15-2020, 06:03 AM
Last Post: ndc85430
  StopIteration exception when mock PostgreSQL connection in several tests igor87z 1 4,587 Jun-10-2020, 06:16 PM
Last Post: ibreeden
  Running tests in a sibling directory to code sodhiar 1 5,113 Nov-07-2019, 11:28 PM
Last Post: MckJohan
  pytest loop through multiple tests? burvil 0 5,939 Sep-26-2019, 11:42 PM
Last Post: burvil
  How do i write tests for this code? hshivaraj 0 2,975 Apr-27-2019, 05:28 PM
Last Post: hshivaraj
  Python unittest - running multiple tests from CSV file asheru93 0 5,884 Jan-21-2019, 08:26 AM
Last Post: asheru93
  Installing and running a python web scraping app from github to a windows 8.1 system eugenioca 17 14,018 Oct-06-2018, 08:14 AM
Last Post: eugenioca

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020