Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9269159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:02:44+00:00 2026-06-18T15:02:44+00:00

I have a PyDev unit test module that lives at the path: $(PYDEV_PROJECT_ROOT)/tests/my_unit_test.py I

  • 0

I have a PyDev unit test module that lives at the path:

$(PYDEV_PROJECT_ROOT)/tests/my_unit_test.py

I am attempting to use Eclipse PyDev’s unit testing facilities. My unit test must read a configuration file like so:

(foo,bar,baz) = myModule.readOptimizationConfig("tests/optimization_config_file.cfg")

However, this will not work because PyDev goes into the ‘tests’ directory before running, and so specifying ‘tests/’ in the path given to readOptimizationConfig makes it attempt to load

$(PYDEV_PROJECT_ROOT)/tests/tests/optimization_config_file.cfg

However, I also need to run these tests using nosetests from the command lin.
This is because, in order to run ALL the tests for my project, rather than the option for running them in a particular file that is provided by default, the easiest solution was to just use the ‘nosetests’ command, rather than messing with Eclipse launch configurations. However, nosetests needs to be be run from the $(PYDEV_PROJECT_ROOT) root directory, so it needs the ‘tests/’ specified in the path.

Is there a way to force eclipse to run the unit tests from the project root directory, so that the paths that I pass to readOptimizationConfig will work for both methods?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T15:02:45+00:00Added an answer on June 18, 2026 at 3:02 pm

    It is possible to do this in PyDev, but you have to do it per every launch configuration so it’s a bit boring.

    Anyway, you first try to run as your script containing the unit-test (as you normally would – e.g. the dropdown menu next to the green “Run” arrow button then Run as… – Python unit-test). This launch will fail because of your missing cfg file. Now go to Run configurations (Run dropdown – Run configurations), open the Arguments tab and in the bottom under Working directory enter the path you want (or browse for it using the Workspace… button). For example if you want to run from project root and your project is called awesome-project, you would write:

    ${workspace_loc:awesome-project}
    

    Now you should have a valid launch configuration that you can use from both the Run and Debug menus. I sometimes rename these configurations to something noticeable right away e.g. “awesome-project TEST”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get hold of Django. I use Pydev on Eclipse. I have
I am unit-testing my python code in eclipse using PyDev unit-testing. I right click
Is there a way to integrate background unit tests with the Pydev Eclipse environment?
Eclipse (3.4.2 with PyDev) deals with out-of-sync resources (files that have been edited outside
I have started a Eclipse PyDev project, and found out that BeautifulSoup was missing.
I have two questions in regards to the PyDev (Python editor for Eclipse) and
I currently have a project in eclipse and Im using Pydev, and im trying
I installed Eclipse and PyDev and I'm wondering if I have to setup anything
I am using Eclipse + pydev and have no existing source folders, but have
I have Eclipse working and am working uder the Pydev plugin, and I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.