Closed chetan51 closed 9 years ago
What do you have under the cursor when you use the feature?
I tried putting the cursor on the following lines:
https://github.com/numenta/nupic/blob/master/tests/unit/py2/nupic/research/temporal_memory_test.py#L41 https://github.com/numenta/nupic/blob/master/tests/unit/py2/nupic/research/temporal_memory_test.py#L47
Well, as you can see here, this project seems to be really complex, make sure that you can run the tests following their instructions there and if you are able to pass the tests then you should configure the anaconda's test runner in order to run the tests in that project cos they aren't going to work out of the box.
Take a look at the anaconda's test runner documentation for more information
Installing nupic in a virtual environment and following the procedure below I managed to run the whole test suite (I am not familiar with pytest so I am not sure how the configuration to make test under the cursor be fired will be, but I am pretty sure that it can be configured)
I cloned numpic in my /tmp
directory.
mkvirtualenv borrame
cd /tmp/numpic
pip install -r external/common/requirements.txt
python setup.py build
python setup.py develop
Then I saved a project file for numpic and configured it as:
"settings":
{
"python_interpreter": "/home/damnwidget/.virtualenvs/borrame/bin/python",
"test_command": "python /tmp/nupic/scripts/run_tests.py -u",
"test_before_command": "export NUPIC=/tmp/nupic",
"test_virtualenv": "~/.virtualenvs/borrame"
}
Then when I run, Run full project test suite
It just get tested:
========================================================= test session starts ==========================================================
platform linux2 -- Python 2.7.6 -- pytest-2.4.2 -- /home/damnwidget/.virtualenvs/borrame/bin/python
plugins: xdist, cov
collected 815 items / 2 skipped
tests/external/py2/asteval_test.py:32: TestCase.testImportAndVersions PASSED
tests/external/py2/testfixture_test.py:48: TestPytest.testSetUpModuleCalled PASSED
tests/unit/py2/nupic/utils_test.py:37: UtilsTest.testMovingAverage PASSED
tests/unit/py2/nupic/utils_test.py:76: UtilsTest.testMovingAverageInstance PASSED
tests/unit/py2/nupic/algorithms/anomaly_likelihood_jeff_test.py:166: ArtificialAnomalyTest.testCaseContinuousBunchesOfSpikes PASSED
tests/unit/py2/nupic/algorithms/anomaly_likelihood_jeff_test.py:250: ArtificialAnomalyTest.testCaseIncreasedAnomalyScore PASSED
tests/unit/py2/nupic/algorithms/anomaly_likelihood_jeff_test.py:193: ArtificialAnomalyTest.testCaseIncreasedSpikeFrequency PASSED
tests/unit/py2/nupic/algorithms/anomaly_likelihood_jeff_test.py <- ../../home/damnwidget/.virtualenvs/borrame/local/lib/python2.7/site-packages/unittest2/case.py:58: ArtificialAnomalyTest.testCaseMissingBunchesOfSpikes SKIPPED
...
tests/unit/py2/regions/regions_spec_test.py:75: KNNAnomalyClassifierRegionTest.testValidOutputSpec PASSED
tests/unit/py2/regions/regions_spec_test.py:110: KNNAnomalyClassifierRegionTest.testValidParameterSpec PASSED
tests/unit/py2/regions/regions_spec_test.py:163: KNNAnomalyClassifierRegionTest.testValidSpec PASSED
=============================================== 800 passed, 17 skipped in 115.47 seconds ===============================================
note: the output has been shortened for displaying purposes
Thanks for putting in the effort! I was already able to run all the tests in the project, but I wasn't able to run an individual test using anaconda. Were you able to use the "Run test under cursor" on an individual unit test in the project?
Nope, I have no idea how to run individual tests using pytest, I just managed to run tests on current file using "test_command": "python -m unittest",
What does anaconda's feature "Run test under cursor" do in order to run an individual test? I am trying to make that work with the nupic project.
Thanks. I'm curious, if you run the same unit test using the "Run test under cursor feature" that I pointed out in my original description, in your cloned nupic repo, what do you see? Do you see the error I mentioned?
Yes.
I'll take a look on that this weekend but fixes wouldn't be available until 1.3.5
Thanks so much!
This error has been fixed in branch fix238, waiting for release v1.3.6
Thanks!
When I use the "Run test under cursor" feature, I see the following error in my Sublime Text console: