Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
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 ...
dshanahan's user avatar
  • 734
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 ...
benjimin's user avatar
  • 4,770
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: ...
dputhier's user avatar
  • 804
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 ...
Jon Olav Vik's user avatar
  • 1,461
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 ...
Edmon's user avatar
  • 4,852
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='...
user avatar
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 ...
Mr Shark's user avatar
  • 26.4k
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 ...
burnpanck's user avatar
  • 2,176
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()}) ...
Reece's user avatar
  • 8,008
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 ...
joeln's user avatar
  • 3,633
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 ...
Andy's user avatar
  • 10.9k
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 ...
jb.'s user avatar
  • 23.9k
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(): """ >...
Scharron's user avatar
  • 17.7k
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: ...
rrw4's user avatar
  • 61
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 ...
Andrea Zonca's user avatar
  • 8,773
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 ...
mit's user avatar
  • 11.2k
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 ...
Bite code's user avatar
  • 595k