summaryrefslogtreecommitdiff
path: root/unit_tests
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #787 from AntoineD/masterJohn Szakmeister2014-04-101-0/+12
|\ | | | | | | Fix #786: generator method fails with callable instance
| * Fix #786: generator method fails with callable instanceAntoine Dechaume2014-04-101-0/+12
| |
* | Fix try_run on pypy.John Szakmeister2014-03-281-1/+2
| | | | | | | | | | | | | | This is a continuation of the fix started in 192694ed for issue #783. Pypy didn't like the tactic taken, so let's be a little more direct about it. We're expecting a function, and if we don't get it then we want to look at the `__call__()` attribute.
* | Fix #782: Make doctest work with new configparser versionsDmitry Shachnev2014-03-181-5/+5
|/ | | | | | Upstream changeset http://hg.python.org/cpython/rev/791674a74e47 switched format from %s to %r, so we need to add some ellipses to work with both old and new versions.
* Fix a test in test_twisted.John Szakmeister2014-02-281-1/+1
| | | | | | With the new top-level domains, x.y.z became a valid domain name. The IETF has set stated that .invalid may not be installed as a top-level domain, so let's use x.y.invalid instead.
* Merge pull request #727 from malthe/fix-builtin-filteringJohn Szakmeister2014-02-121-0/+20
|\ | | | | Fixed issue with builtin filtering.
| * Fixed issue with builtin filtering.Malthe Borch2014-02-121-0/+20
| | | | | | | | | | | | | | | | | | | | The superclass (which ultimately inherits from 'Handler') checks against any registered filters, before allowing a logging record. Nose's logging capture plugin should do the same, because these filters are allowed to modify the record. And it can easily happen that the logging format requires this modification (e.g. add an attribute).
* | Add test that transplants a function generatorMichael Killough2014-01-031-1/+45
| | | | | | | | | | | | | | Currently failing due to issue 501. When the test is transplanted it is wrapped in another function, which means that inspect.isgeneratorfunction() returns False. There is already a fix for this in pull 620.
* | Merge pull request #724 from jszakmeister/fix-some-unicode-errorsJohn Szakmeister2013-10-211-34/+0
|\ \ | | | | | | | | | | | | Fixes some unicode errors/handling in several areas of Nose. A special thanks to Thomas Kluyver (@takluyver) for all the reviews while getting this together.
| * | Fix #692: UnicodeDecodeError in xunit when capturing stdout and stderrJohn Szakmeister2013-08-111-34/+0
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It turns out that `Xunit` was very mix-brained about how to formulate the blocks ultimately used for generating the report. In some parts, the expectation was to put unicode strings into the blocks, and in others it would insert encoded strings along with unicode strings into the blocks. It's the latter that was ultimately causing the issue. In particular, `_quoteattr` would sometimes receive a unicode string, and then it would get translated into UTF-8. Then, it would get inserted into a unicode string, which would cause Python to try and turn the UTF-8 encoded string back into a unicode one, but it would default to the ascii codec and fail. This makes us use unicode everywhere, sometimes forcing the data into unicode with replacement.
* | Merge pull request #685 from lukaszb/ignore-config-filesJohn Szakmeister2013-09-211-1/+32
|\ \ | | | | | | Added NOSE_IGNORE_CONFIG_FILES as env variable option
| * | Added NOSE_IGNORE_CONFIG_FILES as env variable optionLukasz Balcerzak2013-05-091-1/+32
| |/
* | Failing test for modules with names starting with __init__ that aren't ↵Paul Bonser2013-07-313-0/+12
|/ | | | __init__.py
* Fix #447: doctests fail when getpackage() returns NoneMatthew Brett2013-04-154-0/+53
| | | | | | | | When loading tests from a compiled extension, the result of `getpackage(filename)` can be None, causing an error in `DocTestCase.id()` when it tries to use the result as a string. To fix this, let's return the name of the doctest itself just like an alternate path in `DocTestCase.id()`.
* Merge pull request #553 from Infinidat/masterJohn Szakmeister2013-02-102-0/+39
|\ | | | | fix #135 and update plugin documentation
| * Stop mangling error output.Arnon Yaari2013-02-052-0/+39
| | | | | | | | | | | | | | | | This fixes #135 and #511. Some exceptions, like a KeyError, could cause the error output to become mangled. To prevent this, we'll re-wrap the error output in an Exception so that it can be formatted correctly by the remaining layers. A test has also been added to prevent further regressions.
* | Merge pull request #607 from jszakmeister/fix-resource-warningsJohn Szakmeister2013-02-081-1/+2
|\ \ | | | | | | Fix most resource warnings under 3.2 and 3.3.
| * | Fix a ResourceWarning in test_xunit.John Szakmeister2013-01-201-1/+2
| | |
* | | Merge pull request #603 from saschpe/master-plugin-failuredetail-no-tbJohn Szakmeister2013-02-081-0/+23
|\ \ \ | | | | | | | | Fix formatFailure expection if missing tb in exc_info
| * | | Fix formatFailure expection if missing tb in exc_infoSascha Peilicke2013-01-181-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The FailureDetail plugin should not fail in formatFailure if no traceback is in the exc_info tupple ('err' parameter). This happens, e.g. when used with testtools: Traceback (most recent call last): File "/usr/lib64/python2.6/site-packages/nose/case.py", line 133, in run self.runTest(result) File "/usr/lib64/python2.6/site-packages/nose/case.py", line 151, in runTest test(result) File "/usr/lib64/python2.6/unittest.py", line 300, in __call__ return self.run(*args, **kwds) File "/usr/lib64/python2.6/site-packages/testtools/testcase.py", line 518, in run return self.__RunTest(self, self.exception_handlers).run(result) File "/usr/lib64/python2.6/site-packages/testtools/runtest.py", line 74, in run return self._run_one(actual_result) File "/usr/lib64/python2.6/site-packages/testtools/runtest.py", line 88, in _run_one return self._run_prepared_result(ExtendedToOriginalDecorator(result)) File "/usr/lib64/python2.6/site-packages/testtools/runtest.py", line 107, in _run_prepared_result handler(self.case, self.result, e) File "/usr/lib64/python2.6/site-packages/testtools/testcase.py", line 494, in _report_failure result.addFailure(self, details=self.getDetails()) File "/usr/lib64/python2.6/site-packages/testtools/testresult/real.py", line 605, in addFailure return self.decorated.addFailure(test, err) File "/usr/lib64/python2.6/site-packages/nose/proxy.py", line 146, in addFailure formatted = plugins.formatFailure(self.test, err) File "/usr/lib64/python2.6/site-packages/nose/plugins/manager.py", line 99, in __call__ return self.call(*arg, **kw) File "/usr/lib64/python2.6/site-packages/nose/plugins/manager.py", line 141, in chain result = meth(*arg, **kw) File "/usr/lib64/python2.6/site-packages/nose/plugins/failuredetail.py", line 41, in formatFailure tbinfo = inspect_traceback(tb) File "/usr/lib64/python2.6/site-packages/nose/inspector.py", line 26, in inspect_traceback while tb.tb_next: AttributeError: 'NoneType' object has no attribute 'tb_next'
* | | | Merge pull request #595 from mwilliamson/bugfixJohn Szakmeister2013-02-081-0/+20
|\ \ \ \ | |_|_|/ |/| | | Fix: missing method on test class from another module raises error
| * | | Fix: missing method on test class from another module raises ErrorMichael Williamson2013-01-071-0/+20
| |/ /
* | | Merge pull request #520 from Bahus/patch-1John Szakmeister2013-01-211-0/+25
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bugfix for the issue #109: Fails to properly parse NOSE_COVER_PACKAGE environment variable. Also added a test. Note: I did not merge the other patch on this branch (ffc3701) because I'm not sure it's the right fix.
| * | | Add a test for #109: Fails to properly parse NOSE_COVER_PACKAGE.John Szakmeister2013-01-211-0/+25
| | | | | | | | | | | | | | | | This also provides a place to do more testing of the coverage plugin.
* | | | Merge pull request #572 from bfroehle/loader_usage_txtJohn Szakmeister2013-01-201-38/+10
|\ \ \ \ | |_|_|/ |/| | | Use `nose.__loader__` to load 'usage.txt', if available.
| * | | Use `nose.__loader__` to load 'usage.txt', if available.Bradley M. Froehle2012-12-271-38/+10
| | |/ | |/| | | | | | | | | | | | | | | | Previously we only used `nose.__loader__` if we thought that the loader was zipimporter. Additionally, we use `nose.__file__` to build the path to 'usage.txt' as suggested by PEP-302.
* | | Updated timed decorator to return result of function.Praful Mathur2013-01-181-0/+6
|/ /
* | Merge pull request #563John Szakmeister2012-12-101-0/+4
|\ \
| * | test_utils: add some edge cases to test_test_addressJohn Szakmeister2012-09-291-0/+4
| |/
* | Merge pull request #562 from santtu/masterJP2012-10-301-2/+19
|\ \ | | | | | | Make logcapture log mutable objects consistently
| * | Format captured log records immediately to have consistent formatting of ↵Santeri Paavolainen2012-09-301-2/+19
| |/ | | | | | | | | | | mutables. This is a fix for https://github.com/nose-devs/nose/issues/561
* | Merge pull request #564 from jszakmeister/xunit-capture-stdoutJP2012-10-111-4/+6
|\ \ | | | | | | Teach xunit to capture stdout...
| * | xunit: capture stdout out into the system-out tagJohn Szakmeister2012-10-021-4/+6
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the score of Xunit to place it before the Capture plugin. We don't want the Capture plugin to change the streams before the tests are run. At a score of 2000, that's exactly what happens, so let's make it 499 instead (Capture's score - 1). Have Xunit replace the stream with a Tee object of just swapping the stream. This allows the Capture plugin to see the data from stdout, even though we've replaced the stream, allowing it to function exactly as you would expect it to. Finally, we maintain a stack of streams, instead of just a single stream. I don't believe this is entirely necessary though.
* | test_xunit: Replace an embedded tab with spacesJohn Szakmeister2012-09-291-2/+2
|/
* add loglevel option to logcapture plugin and add associated testArach Tchoupani2012-01-251-3/+18
|
* Define __unittest in scope of nose's assertion helpers to hide noisy stack ↵Erik Rose2011-12-181-17/+33
| | | | | | frames. Closes #453. I divided the tools into two buckets: trivial, which should not have their stack frames exposed in tracebacks; and nontrivial, which should. The tools module becomes a package, and everything stays backward-compatible.
* Mergedkumar2011-07-075-16/+56
|\
| * Fixes Xunit so it represents generator test names correctly (Issue 369)kumar2011-06-171-1/+21
| |
| * case.shortDescription() is more forgiving to __str__ errors (issue 422)kumar2011-05-271-0/+11
| |
| * Merged with attr plugin fixeskumar2011-05-021-2/+4
| |\
| | * Re-enabled the pickling test in multiprocessing since it works. woo!kumar2011-05-021-2/+4
| | |
| * | Overhaul the Attribute Selector plugin to fix the following bugs:Bobby Impollonia2011-05-011-6/+10
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #412 : Attributes don't work on inherited test method Issue #411 : Plugin doesn't work on classes containing static methods Issue #324 : Mixing method and class attributes doesn't work Issue #381 : Plugin doesn't work on classes containing methods with no __dict__ (e.g., from boost.python) Issue #382 : Dupe of #381 with less info * When used as class decorator, attr() was only applying the attributes to methods with names starting with "test_". It would skip, e.g., my_cool_test. * The class decorator form of attr() did not work for test methods inherited from parent classes, nor were the attributes inherited by child classes. They also didn't work for methods added to the class later (e.g., by another decorator). The primary changes are to use getattr/ setattr exlusively rather than direct access to __dict__ and to remove the (unneeded and problematic) wantClass method. Most of the bugs were caused by __dict__ access or wantClass not doing the right thing. In addition to fixing the above bugs, these changes make the plugin smaller and simpler to understand. Add regression tests for fixed bugs. Change assert not plug.wantFunction(h) to assert plug.wantFunction(h) is False where plug.wantFunction only return None or False Refactor duplicated code in functional tests into base class.
| * Skipping pickle test because it gets stuck in an infinite loop (see Issue 399)kumar2011-04-191-0/+1
| |
| * New multiprocessing declares byte values correctly (part of Issue 399)kumar2011-04-182-5/+3
| | | | | | | | Some tests also needed tuning to pass consistently in all versions of Python.
| * Revised multiprocessing so it works for test generators (Issue 399)kumar2011-03-271-4/+8
| | | | | | | | Patch by Rosen Diankov. Note: failing in Python 3, still needs work.
* | Fix up broken unit test.Gary Donovan2011-07-061-1/+1
| |
* | Be able to specify ignoreFiles as a parameter, overriding defaults.Gary Donovan2011-07-062-0/+50
|/
* Attempts to force a binary (string) result in python 3 to fix encoding problemkumar2011-03-271-1/+1
|
* Fixes mishandling of custom exceptions during failures (Issue 405)kumar2011-03-221-1/+25
|
* Fixes capture plugin when exception message contains non-ascii chars (Issue 402)kumar2011-03-211-0/+13
|