All Questions
17 questions
0
votes
1
answer
74
views
python nose --with-doctest adding extra test
I am needing to defer the import of some libraries unless they are needed so I have created have an object to defer the import.
class Importer(object):
def __init__(self, name):
self.name ...
0
votes
1
answer
119
views
What is the protocol for loading test suites for both nose and unittest?
I used the unittest load_tests() protocol, because I want my automated tests to include a doctest but only for one module. This works fine when discovered and run by unittest, but fails when instead ...
1
vote
1
answer
60
views
disabled one example test with nose
Is there a way to tell nose not to test a particular function foo() enclosed in a file containing other functions that need to be tested ?
def foo():
'''Was the function does.
:Example:
...
2
votes
1
answer
2k
views
How to set parameters for test runner in PyCharm
I'm new to PyCharm. How do I set options for nosetests when running doctests from PyCharm? In Eclipse PyDev, this setting is under Window > Preferences > PyDev > PyUnit; I select the "Nose ...
2
votes
0
answers
402
views
Executing doctest Unitests from Jenkins
I am struggling to find a good, well documented approach for execution of doctest-based Python unit test from the Jenkins continuous integration server.
I have seen approaches where the doctests are ...
0
votes
1
answer
2k
views
Doctest: Splitting a docstring for Python function call over multiple lines
I am wondering if there is a way to split function calls over multiple lines for doctest. E.g., for something like
>>> result = some_func(some_param=1, another_param=4, a_third_param='...
2
votes
1
answer
150
views
Selecting doctests with attributes/tags in nosetest
I have a project containing both doctests and Unittest based tests that are run using nosetest.
Since some of the tests are slow and relies on an external database, I want to use tagging to select ...
5
votes
2
answers
527
views
nose-doctest module fixture before module is imported
I use nose for test collection and I also want to use its doctest plugin. I have a module that needs a fixture in order to be importable. Therefore, I cannot use nose's module fixtures, since they are ...
4
votes
0
answers
159
views
Is there a way to get extraglobs-like behavior when invoking doctests through nosetests?
At the bottom of a Python module, I have:
if __name__ == "__main__":
import doctest
import hgvs.dataproviders.uta
doctest.testmod(extraglobs={'hdp': hgvs.dataproviders.uta.connect()})
...
2
votes
2
answers
304
views
Disable nose running setup()
The nose package is often used to run doctests as well as tests in dedicated test files. It appears that even in doctest files, it attempts to run the setup and teardown fixtures.
When the module for ...
2
votes
1
answer
3k
views
nosetests: error: no such option: --with-doctest
I am trying to run all doctests in all modules, but get the following result:
$ nosetests --with-doctest
Usage: nosetests [options]
nosetests: error: no such option: --with-doctest
Something is ...
1
vote
1
answer
636
views
Force nosetests to find doctests in modules starting with underscore
Basically in project I use following pattern:
package:
__init__.py
_mod1.py
_mod2.py
These modules are considered implementation detail and I don't want users to import them. I use ...
4
votes
1
answer
1k
views
Nose does not run doctests from imported modules
I have a project with a structure like that :
my_project_with_tests/
project/
__init__.py
module.py
test/
test.py
module.py contains two doctest'ed functions:
def foo():
"""
>...
6
votes
3
answers
1k
views
django doctests not being run
I'm having a problem running django doctests with django-nose. Unit tests added to a /tests directory are running fine, but doctests are not.
I am trying to run doctests on my "season" module:
...
7
votes
2
answers
1k
views
python doctest default namespace
In the doctests of my module I would like to reference my module with the full namespace, for example:
hp.myfunc(1)
And I would like to avoid cluttering the doctests by writing:
import healpy ...
0
votes
1
answer
152
views
How to find out the location of a doctest file when running nose?
I am using python nose to run a bunch of doctests in subdirectories. The calling script is nose.cmd:
nosetests --with-doctest --doctest-extension=rst
(The doctests live in *.rst files.)
Example ...
7
votes
1
answer
1k
views
Why does nose finds tests in files with only 644 permission?
Today I ran a bunch of doctests using Python 2.6 on a Ubuntu 9.10 with nose :
nosetests --with-doctest
Ran 0 tests in 0.001s
OK
WTF? I had tests in that files, why didn't that work?
I changed ...