| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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!
|
|
|
|
|
|
|
|
|
|
| |
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 xunit when writing unicode to stdout and stderr.
|
| |
| |
| |
| |
| |
| |
| | |
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.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
Fix --cover-min-percentage for both single and multiple packages
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| | |
Anything less, and the tests will run serially and fail the test.
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|/
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
Not sure how this was missed, but we need to call setUp() on the base
class in order to get the output capturing.
|
|\
| |
| | |
Fix most resource warnings under 3.2 and 3.3.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
Thanks to Arfrever for the patch. This fixes #593.
|
|\ \
| | |
| | | |
Disable a timing test under PyPy.
|
| |/
| |
| |
| | |
The warm-up time is just too long.
|
|\ \
| |/
|/| |
Suppress tracebacks caused by ConfigErrors
|
| |
| |
| |
| |
| |
| | |
Show a kind error message instead of a traceback
when an unknown configuration variable is found in
a file.
|
|\ \
| | |
| | | |
Fixed #513: exception in test generator leads to a TypeError.
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
copied into build/tests).
Also, try to make things work under Windows (but untested).
|
|/ /
| |
| |
| |
| |
| | |
from different paths along sys.path, due to e.g. symlinks.
(note: not sure this will work under Windows, this may need further tweaking)
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ \
| | |
| | | |
Teach xunit to capture stdout...
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| |/ /
|/| | |
Handle "--processes=-1" case
|
| | | |
|
| |/
| |
| |
| |
| | |
This should result in automatic selection of processes based on CPU
count rather than hanging.
|
| | |
|
| | |
|
|/ |
|
| |
|
|
|
|
| |
and Jython
|
|
|
|
| |
PluginManager
|
|\ |
|
| |
| |
| |
| | |
machines (like the CI server)
|
| | |
|