PyCharm new project test runner default to Twisted Trial - unit-testing

When ever I create a new project or open a old one in PyCharm the test runner default to Twisted Trial.
I did some search and found that I can change project level default by Setting->Tools->Python Integrated Tools-> Default test runner
But not able to change the global default test runner for PyCharm.
The "Tools" option is not available in "Default Settings".
How to set up PyCharm so that the default test runner is "Unittests".
PyCharm Version - 2018.1 Community Edition
Python2.7

Unfortunately, Integrated Tools submenu is not available in default settings so there's no way to set this option globally, please vote for the corresponding ticket in PyCharm bug tracker: PY-20243.

Related

Debug Cypress in WebStorm in 2021

Since the WebStorm debugging extension for Chrome is deprecated, how would I debug a Cypress instance? How do I select the correct Chrome instance (the Cypress one) to attach to in the "JavaScript Debug" config?
You can try attaching via the Attach to Node.js/Chrome run configuration (similar to VSCode recipes in Debugging Cypress tests in Visual Studio Code), but, as I mentioned in my comment at Debug Cypress in WebStorm, it worked for me neither in Webstorm nor in VSCode...
Did you try the Cypress Support Pro plugin? According to https://docs.cypress.io/guides/tooling/IDE-integration#IntelliJ-Platform, it supports debugging from the IDE

PyCharm professional edition cannot support Django

I have PyCharm professional edition, and I have been trying to PyCharm and Django. However, it seems that I could not enable Django support in PyCharm. As shown in the following figure, when I try to enable Django support in the PyCharm setting, there is nothing shown for Django.
Can anyone help me identify the issue?
That's because you haven't created a project yet. You get this screen because you're still in the step before creating a project.
Create a new project
Select Django on the left column
Enter a name for your project
Select (or create on the fly) a virtualenv
Click the Create button
Now, after project has been created, you can go to Languages & Frameworks => Django and then enable the Django support by selecting your project root directory and your settings.py file.

PyCharm coverage only measures test directory for a GAE app with Selenium tests

I'm developing a GAE app in Python using the PyCharm IDE. I have developed an initial set of Selenium WebDriver unit tests, which are in directory "test", with "test" at the top level of the project directory. Note that my tests do not directly call the GAE modules. They only utilize Selenium, which in turn runs the app thru a browser.
When I use menu option "Run 'Unittests in test' with coverage", I get a report showing coverage within directory "test", and also the colors show up in the left margin for the Python modules in "test". The information looks accurate. Very cool!
However, the rest of the files in my project show "not covered", even though the tests exercise a lot of that code via Selenium remote control of a browser.
In settings, I've tried checking "Use bundled coverage.py" and, after running sudo pip install coverage, I've also tried unchecking "Use bundled coverage.py". My results are the same either way.
Is it possible that you simply cannot obtain coverage of a GAE app being exercised via Selenium?

TF900547: The directory containing the assemblies for the Visual Studio Test Runner is not valid but can't see MSTest.exe

I'm getting the following error on a TFS2013 build:
TF900547: The directory containing the assemblies for the Visual Studio Test Runner is not valid ''.
Looking here, it would seem that the answer to this is to change the test runner from VS test runner to MSTest. However, when I try to edit the Test Run in the build definition, the test runner option is set to Visual Studio Test Runner and greyed out. What determined what is shown in this box, and how can I add MSTest?
I have installed VS2012 agents for handling tests on the server.
I fixed this by installing VS2013 on the build agent
We had the same problem as the OP but, because the TFS server is considered a production box (other departments use it for other things), we were not permitted to install VS2013 on the server. The same applied to any third party tools needed for builds, they were a pain to integrate into the build.
I eventually worked round this by using another dev box to act as a build server for TFS. By installing the Build Server component of TFS on the dev box and setting up a controller and build agents on that box, TFS could pass the responsibility for the actual build to the dev box, on which we could install anything, without compromising the TFS server itself.
While it is not perfect - an extra box and VS2013 license needed - it is by far the easiest way to avoid poluting a production TFS box. Alternatively, nominate a developer's own box and install the build agent there - the environment is ready built, it will simply slow down a little during a build.
Look at section Define Multiple Test Runs of this article. It is very informative and explains different configuration in dept. Hope this helps !!!

Run Django doctests from PyCharm

PyCharm's test runner does a great job with unit tests, likewise the run command contextually recognizes if you are in a unit test in a helpful way. Is there any way to get it to do the same with doctests running within the Django environment? (As opposed to Python doctests, which PyCharm supports -- but which don't work for a Django project because the run environment isn't set up correctly.)
I don't believe it's possible.
My approach has been to create a "Django tests" configuration and specify a target, custom settings and options. (Menu: Run -> Edit Configurations... -> Click on the + icon to create a new configuration) I do something like this when I'm working in a particular module and simply change the settings appropriately to get the set of tests you want.
Not as nice as having it off the right-click run menu unfortunately.