summaryrefslogtreecommitdiff
path: root/unit_tests
Commit message (Collapse)AuthorAgeFilesLines
* Set __qualname__ equal to __name__ on derived classesDmitry Shachnev2016-02-011-0/+1
| | | | | | To make output on Python ≥ 3.5 the same as on previous Python versions. This fixes #928.
* FIX: Add simple testEric Larson2016-01-271-2/+6
|
* Merge an amended version of #896.John Szakmeister2015-11-281-11/+92
|\ | | | | | | Adds an option to specify the location of the coverage config file.
| * Fix a coverage plugin test to work with newer versions of coverage.John Szakmeister2015-11-281-21/+38
| |
| * Adds an option to specify the location of the coverage config file.Brian Reinhart2015-11-281-11/+75
| |
* | test: add test with custom class name prefixJoscha Feth2015-11-291-8/+25
| |
* | feat: adds an option that allows prefixing the class name in an xunit reportJoscha Feth2015-11-291-7/+53
|/
* fake stdout should always have encoding attributeMatt Chisholm2015-11-281-0/+7
| | | | Some programs expect this attribute, and use it to encode strings before writing to stdout. If it's not there, they fail with an AttributeError.
* Merge an amended version of #945.John Szakmeister2015-11-281-4/+30
|\ | | | | | | Tee doesn't have encoding and errors attributes.
| * Skip distutils.log test if distutils.log is not available.John Szakmeister2015-11-281-2/+11
| |
| * BUG: Tee doesn't have encoding or errors attrs.Prabhu Ramachandran2015-08-271-4/+21
| | | | | | | | | | | | On Python3, distutils.log uses the encoding and errors attribute of sys.stdout and stderr. Tests error out when nose is run with xunit and it replaces the stdout/stderr with a Tee.
* | Merge pull request #948 from adamchainz/logcapture_propagate_falseJohn Szakmeister2015-11-281-0/+18
|\ \ | | | | | | Fix logcapture plugin to capture output from non-propagating loggers,…
| * | Fix logcapture plugin to capture output from non-propagating loggers, and to ↵Adam Chainz2015-09-041-0/+18
| |/ | | | | | | not output 'no handlers could be found' message
* | unit_tests/test_cases: add tests for {Function,Method}TestCase.__repr__Lewis Haley2015-10-161-0/+40
|/ | | | | | | | | | | | | | | | | | | | | | At present, if a mutable argument is changed during the execution of test case, then any printing of the test case object which occurs after the test has run will result in the argument being printed with a __repr__ of it's *new* state (assuming that its __repr__ is state-dependant). This is particularly confusing when debugging failing test cases because the summary lines and the failure-detail lines will show *different* __repr__s of the args, e.g. nose_weirdness.test_nose_is_weird(Foo(10), 0) ... FAIL ====================================================================== FAIL: nose_weirdness.test_nose_is_weird(Foo(0), 0) ---------------------------------------------------------------------- ... Ran 1 test in 0.001s FAILED (failures=1) This issue will be solved in the next commit.
* Fix for try_run when using bound methodsChristian Lyder Jacobsen2014-05-081-0/+6
|
* 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
|