summaryrefslogtreecommitdiff
path: root/functional_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 #931: duplicate __init__ modules can be picked upJohn Szakmeister2015-10-201-1/+4
| | | | | | | | | | The short form here is that when setting up ignores, you may allow __init__.py to be included unexpectedly. Since we generally use loadTestsFromName(), the package should be imported first which will handle the __init__.py case. Therefore, let's always ignore it in the loadTestsFromDir() method. Just to make sure that we ignore the correct files, we need to run the entry name through src() to make sure we handle the situation correctly on other platforms (like Jython).
* Skip the multiprocess keyboard interrupt tests on certain platforms.John Szakmeister2015-06-011-0/+4
| | | | | We need os.setsid() and os.killpg() to be available to use these tests. Skip the tests on platforms that don't have them both.
* Update a coverage plugin test to work with coverage 4.0.John Szakmeister2015-01-251-1/+6
| | | | | The new coverage appears to provide some more information about the uncovered lines than previous versions.
* Fix #875: nose doesn't collect tests when subpackage is given as argJohn Szakmeister2015-01-254-7/+62
| | | | | | | | | | | | | | When a subpackage is specified on the command line (e.g., `nosetests foo.bar`), it should pick up all the tests below the subpackage. The root of the problem came from how we resolved a filename for a package. We should really point to the package directory, instead of providing the path to the `__init__.py` file. Otherwise, we only end up attempting to select modules from the `__init__.py` instead of the whole tree underneath. We don't want to check for a path ending in `__init__.py` in `loadTestsFromModule()` because then we select the whole subtree of tests when `foo/bar/__init__.py` is specified when only tests in the __init__.py should be selected.
* Fix #859 Xunit plug-in not able to change testsuite nameGaurang0332014-12-142-0/+23
| | | | | | | Added command line parameter in Xunit plug-in to specify test suite name. Also added functional test case. Incorporated Comments
* Add a few tests with raising string exceptions.John Szakmeister2014-04-192-0/+62
|
* Skip coverage tests correctly in Python 2.5 when coverage not available.John Szakmeister2014-04-191-6/+7
|
* Disable test_concurrent_shared.John Szakmeister2014-03-271-39/+42
| | | | It simply causes too many problems with Travis and other build farms.
* Make issue680 test succeed with LC_ALL=CDmitry Shachnev2014-03-191-2/+2
| | | | | | | Previously, it was failing with: nose.proxy.UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 189: ordinal not in range(128)
* Add missing support infrastructure for the attrib-static test.John Szakmeister2014-02-201-0/+4
|
* Fix #728: attrib plugin rejects any staticmethodJohn Szakmeister2014-02-201-0/+10
| | | | | | | | The issue is that static methods get wrapped in an UnboundMethod object, and the attribute plugin is unable to grab the associated class, since UnboundMethod does not have the im_class attribute. Since the goal of UnboundMethod is to mimic an actual method, let's go ahead and implement the im_class attribute.
* Fix #771: attr plugin is broken when parent overrides child methodJohn Szakmeister2014-02-203-10/+32
| | | | | | | | | | | | | | | | | The issue is when the parent and child have different attributes, and the parent method was being bypassed because of the attribute selection. In this case, Nose would incorrectly use the version from the base class, even though it was supposed to skip the method entirely. To fix this, we need simply need to stop digging through base classes. The dir() method returns a flattened set of methods, so there's no need to iterate through the base classes trying to dig up all the methods. Moreover, it leads to false positives since we were not keeping track of methods seen on the parent classes. As a result, we'd incorrectly select a test for inclusion (using attributes), or we'd pick up a method that we should've ignored (like runTest in a Twisted test case). Thanks to Thomas Grainger for providing a test case!
* Fix #720: nose with detailed errors raises encoding errorJohn Szakmeister2013-08-112-0/+20
| | | | | | | | | | In this case, the exception vector being passed in was a string that contained encoded UTF-8 sequences. It was being converted to unicode implicitly, which was raising a UnicodeDecodeError because some bytes were >= 128. Make sure the exception string is converted to unicode before trying to put the whole thing together. Thanks to Guillaume Ayoub for the test case.
* Fix #700: Tee is missing the writelines() method.John Szakmeister2013-06-262-0/+21
|
* Merge pull request #684 from jszakmeister/fix-xunit-unicodeJohn Szakmeister2013-06-012-0/+18
|\ | | | | Fix xunit when writing unicode to stdout and stderr.
| * Fix #680: xunit problem with unicode on stdoutJohn Szakmeister2013-05-072-0/+18
| | | | | | | | | | | | | | It turns out we were trying to write unicode strings into a cStringIO.StringIO object, which doesn't work well with unicode strings. Instead, lets use StringIO.StringIO objects for capturing stdout and stderr.
* | Fix #649: UnicodeDecodeError when an exception contains encoded stringsJohn Szakmeister2013-05-092-0/+27
|/ | | | | | | | | | | | | | | The issue stems from the fact that when you use a coding line in the Python file, and raise an exception that contains unicode characters, the message in the exception is an encoded string. We need to get it converted into unicode, but simply calling `unicode(ev)` doesn't work, as that often fails with a `UnicodeDecodeError` because it assumes `ascii` encoding by default. This fixes the issue by trying to decode the stream as UTF-8, and uses replacement on errors. It's not ideal, but the best we can do since we don't know the encoding of the message string. Thanks to Christoph Zwerschke for the test case.
* Corrected a module path referenceNick Loadholtes2013-04-081-1/+1
|
* Make test_multiprocessing.test_keyboardinterrupt much more reliable.John Szakmeister2013-03-184-16/+50
| | | | | | | | | | | | | | | | It turns out that even under Linux, start up times for subprocesses can vary considerably. As with most threading/multiprocess-based solutions, sleep() proves to be an inadequate solution to knowing when to send a signal to interrupt a waiting process. We may end up sending the kill signal before the child process is on the right statement, causing some assertions to fail in our tests. Instead, let's introduce the concept of a kill file in these tests. The kill file will be generated by the unit-under-test, and we'll wait for them to show up. This works much better since the kill file is created just before the sleep() in the unit-under-test. Once we detect the kill file, then we can remove it, and fire off the signal. Where I was seeing random failures before, I no longer see them now.
* A slightly better fix for #627.John Szakmeister2013-03-171-4/+7
| | | | | | | | The first test should run fine, even if the number of processors is one. That's because we explicitly tell multiprocess to use two process. However, the second test asks multiprocess for the CPU count, and that's where we run into a problem. As a result, we'll only check the cpu count in TestConcurrentSharedWithAutomaticProcessesCount.
* Merge pull request #639 from jszakmeister/coverage-fixesJohn Szakmeister2013-03-171-0/+79
|\ | | | | Fix --cover-min-percentage for both single and multiple packages
| * Fix --cover-min-percentage with single packages.John Szakmeister2013-03-031-0/+79
| | | | | | | | | | | | | | | | | | It turns out that coverage doesn't generate a TOTAL line when only one package is being covered. As a result, we'd fail to parse the output and assert accordingly. Fix this by first trying a multi-package regexp, and fall back to a single package version if the multi-package one fails. Also added several tests to make sure this works with and without --cover-branches.
* | Fix #627: require at least 2 cpus for TestConcurrentSharedJohn Szakmeister2013-03-171-0/+5
| | | | | | | | Anything less, and the tests will run serially and fail the test.
* | Correctly detect the coverage module under Python 3.3.John Szakmeister2013-03-151-1/+6
| | | | | | | | | | | | | | | | Python 3.3 has namespace packages (PEP 420) and the coverage support area is being picked up as one. As a result, when trying to run tests, the current infrastructure believes that coverage is installed when it's not, leading to several test failures. Let's do an additional check to make sure we have the real coverage package installed.
* | Fix a twisted test to work with Twisted 12.3.0 or better.John Szakmeister2013-03-041-1/+11
|/ | | | | | | Twisted has updated trial to work better with unittest's test runner. As a result, skipped tests are no longer reported as failures. Since this is the desired result, fix the test to no longer expect a failure for the skipped test. This was tested from Twisted 10.0 to 12.3.
* test_concurrent_shared.py: fixed a minor typo (seconsd -> seconds)Dmitry Shachnev2013-02-091-1/+1
|
* Finish the setUp() process in TestConcurrentShared.John Szakmeister2013-02-081-0/+4
| | | | | Not sure how this was missed, but we need to call setUp() on the base class in order to get the output capturing.
* Merge pull request #607 from jszakmeister/fix-resource-warningsJohn Szakmeister2013-02-084-9/+21
|\ | | | | Fix most resource warnings under 3.2 and 3.3.
| * Fix a ResourceWarning in init_plugin.rst.John Szakmeister2013-01-201-3/+5
| |
| * Get rid of another ResourceWarning in test_skips for the xunit plugin.John Szakmeister2013-01-201-1/+3
| |
| * Fix a ResourceWarning in test_entrypoints.John Szakmeister2013-01-201-2/+5
| |
| * Fix a ResourceWarning in test_shared.John Szakmeister2013-01-201-3/+8
| | | | | | | | Thanks to Arfrever for the patch. This fixes #593.
* | Merge pull request #605 from jszakmeister/disable-timing-test-under-pypyJohn Szakmeister2013-02-081-0/+10
|\ \ | | | | | | Disable a timing test under PyPy.
| * | Disable a timing test under PyPy.John Szakmeister2013-01-201-0/+10
| |/ | | | | | | The warm-up time is just too long.
* | Merge pull request #528 from andrea-corbellini/masterJohn Szakmeister2013-01-201-2/+2
|\ \ | |/ |/| Suppress tracebacks caused by ConfigErrors
| * Suppress tracebacks caused by ConfigErrors.Andrea Corbellini2012-07-111-2/+2
| | | | | | | | | | | | Show a kind error message instead of a traceback when an unknown configuration variable is found in a file.
* | Merge pull request #598 from mitya57/masterJohn Szakmeister2013-01-182-0/+32
|\ \ | | | | | | Fixed #513: exception in test generator leads to a TypeError.
| * | test_failure.py: make the test a bit more strict (fix by @jszakmeister)Dmitry Shachnev2013-01-181-1/+3
| | |
| * | Add a test case for previous commitDmitry Shachnev2013-01-162-0/+30
| | |
* | | Fix tests under py32 by creating the symlink dynamically (it didn't get ↵Antoine Pitrou2013-01-163-2/+16
| | | | | | | | | | | | | | | | | | copied into build/tests). Also, try to make things work under Windows (but untested).
* | | Issue #535: fix nose.importer to work when the same modules are reachable ↵Antoine Pitrou2013-01-162-9/+47
|/ / | | | | | | | | | | from different paths along sys.path, due to e.g. symlinks. (note: not sure this will work under Windows, this may need further tweaking)
* | test_coverage_plugin.py: skip the tests when coverage is not availableDmitry Shachnev2013-01-111-1/+16
| |
* | Add a test for #134: Stop xunit from completely dying if it encounters an errorJohn Szakmeister2012-12-212-0/+20
| |
* | Another doctest fix to work with Python 3.3.John Szakmeister2012-12-101-8/+8
| | | | | | | | | | | | In Python 3.3, it's quoting the module name with single quotes, which is different than Python previous Python implementations. Use the ELLIPSIS feature to help match around it.
* | multiprocess: make test a little less racyJohn Szakmeister2012-11-111-0/+1
| | | | | | | | | | | | | | | | The other process can start up not long after the module setup and teardown is called. Add another ellipsis in to cover this case. Note: it's feasible that something could sneak in between the setup and teardown as well, but the failures with Travis haven't shown that to be occurring.
* | Merge pull request #564 from jszakmeister/xunit-capture-stdoutJP2012-10-111-1/+1
|\ \ | | | | | | Teach xunit to capture stdout...
| * | xunit: capture stdout out into the system-out tagJohn Szakmeister2012-10-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #517 from myint/cpu_countJP2012-10-011-0/+4
|\ \ \ | |/ / |/| | Handle "--processes=-1" case
| * | Remove redundant codemyint2012-05-131-7/+1
| | |