py.test not found

virtualenv, py.test 2.2.3 installed in environment, python 2.6.5, py.test shows up in Settings | Python Interpreters | Packages.   I can run from the command line without error.

However, when I configure py.test as the Python Integrated Tools | Default Test Runner  I get the message:  "No py.test runner found in the select interpreter"

running the latest 2.5.1 pycharm

Best,

Jeff

6 comments
Comment actions Permalink

Is py.test listed under Packages when you go to Preferences->Project Interpreter->Python Interpreters and select the relevant interpreter in the upper half of the dialog?

Are you using pip?

I'm working under a similar setup and it seems like it's easy to accidentally install a library in a different virtualenv or at the system level.

0
Comment actions Permalink

Yes,  it is listed under the project interpreters.  So is pip.

I've tried invalidating the cache and restarting, also a no-go.  Is it just me or is virtualenv handling feel klunky? Why does one need to set it up at the application level and then assign to a project?  I make and destroy alot of virtualenv's so the whole process feels quite monkey buttonish.  Why can't pycharm just search the immediate vicinity for a bin/activate and then ask, "Do you want to use this virtualenv?"

Also, when using pycharm on an existing project -- I have my own tools for creating VEs and populating them that are more efficient for me than what pycharm offers for creating VEs.  How do you set up pycharm correctly for an existing project?  Start a "new project" or "Open Directory?"

When using "New Project"  pycharm gets all eclipse on me and wants to create the project /home/jlh/PycharmProjects/untitled   but that is not where I keep my projects, I keep them at /home/jlh/projects but I can't convince pyCharm of the fact, it forgets it and goes braindead the next time.  Can I change the default path for that?

Along that same line, Project Name is directly tied to the project location.  Change one and the other changes, the last term of the location is going to be your project name.  So why have two fields, it would seem to suggest that the two are not bound, when in fact they are.

Also, when starting a new project, pycharm wants to give me a list of other VE's which doesn't make the least bit of sense, it should be asking if I want to create a new VE in the new project directory.  I can't figure out how to make it do the right thing.   On top of that, I should be able to give it a template of requirements for the new VE and then be able to modify as needed.

What does "Synchronize" in the file menu do?  There is 0 feedback from the command.

I am evaluating pyCharm and there are a number of features that I very much like, especially with regards to refactoring, etc.   There are lots of knobs and such so I figure that it is probably my newness to the IDE that is causing me problems and look forward to everyone's responses.

Best,

Jeff

0
Comment actions Permalink

So let's go through the questions in order. :-)

- When you use "Open directory" on a project, PyCharm searches for a virtualenv inside that directory, and if it finds one, it configures it automatically and uses it for the project. Given that it's unclear what "immediate vicinity" means, we haven't come up with a better heuristic which could better handle cases when the virtualenv is outside the project directory.

- When you already have an existing project directory, the correct way to open it in PyCharm is to use "Open Directory".

- PyCharm remembers the last path where you've created a project, and the next time you create one, it offers you to create it under the directory you've used previously.

- Having two fields for name and location looks clearer to me (especially given that the name is going to be used as the project name for creating a Django or App Engine application, if that is what you use)

- When you create a new project, you can press the "..." button in the interpreter list and press the "create virtualenv" button there. In this case, the created virtual environment will be assigned to the new project. It's probably not as straightforward as it should be, and it's likely that we'll change this in a future release.

- PyCharm doesn't have a possibility to use a requirements template when creating a virtualenv. You're welcome to file a feature request at http://youtrack.jetbrains.com/

- "Synchronize" forces PyCharm to reload changed files from the file system. Normally PyCharm detects and reloads changed files automatically, and in this case "Synchronize" really does nothing.

0
Comment actions Permalink

- Open Directory v. New Project -- Just to make sure that my fidgeting with the knobs was not getting in the way, I fired up a new VE and told PyCharm to "Open Directory" and all was good.  It found my py.test, etc.  (As to my vicinity comment, yes, PyCharm is doing what I would expect it to do.)

Follow up Question:  If I believe that I've munged up my project settings with respect to PyCharm, how can I tell PyCharm to forget what it thinks it knows and retry fresh?  Do I just:

* Close PyCharm

* ``rm -rf .idea`` in the project directory?

* restart PyCharm and Open Directory on the project?

- PyCharm remembers the last path where you've created a project, and the next time you create one, it offers you to create it under the directory you've used previously.

ok.

- Having two fields for name and location looks clearer to me (especially given that the name is going to be used as the project name for creating a Django or App Engine application, if that is what you use)

ok.  see your point.  My VE's are named project-what-ever-problem I'm working on a fix/issue.  Then below that are  bin/, include/, lib/,  and src/ .  src is the checked out project code.  That way any custom project tools I've written know that layout,etc.  strictly a me-preference thing, but hey, It's how I roll.

- PyCharm doesn't have a possibility to use a requirements template when creating a virtualenv. You're welcome to file a feature request at http://youtrack.jetbrains.com/

will do.  Although I don't know if it will help me.   I essentially use a mini-chef type system that I built for myself years ago.  I feed it a requirements file and my VE gets built, populated, and source code pulled down, etc.

Dimitry, thank you for your prompt responses.  I've been away from my computer for a few days, (lovely vacation time) but now I look forward to my ongoing eval of pycharm.

Best regards,

Jeff

0
Comment actions Permalink

Hello Jeff,

Indeed, deleting .idea and using "Open Directory" in PyCharm will cause it to re-auto-configure the project.

0
Comment actions Permalink

Had the same issue, invalidating the cache and restart worked for me

0

Please sign in to leave a comment.