kakyo
kakyo

Reputation: 11590

python: Run coverage on folder with tests in another folder (Eclipse PyDev)

I have my python modules in a folder A, but my tests in a folder B. When using coverage in Eclipse Pydev, how can I make this setup work?

Things tried:

  1. Currently if I use A for the folder, got 0% coverage;
  2. If I link B into the project and it sees my test classes as code classes.
  3. Then I tried to copy all my tests over into A and run it again, still 0% coverage.

Upvotes: 1

Views: 320

Answers (1)

PurityLake
PurityLake

Reputation: 1120

if you want the python compiler to know where they are you can simply add their path to sys.path, is this what you are looking for?

link to sys.path in python documentation

EDIT: try using something like

sys.path.append(r"C:\path\to\tests")

Upvotes: 1

Related Questions