Robert Collins added the comment:
w.r.t. a new linecache interface, it looks like we need two attributes from
f_globals: __name__ and __loader__, so that we can eventually call
__loader__.get_source(__name__).
One small change (to let me focus on traceback) would be to add another kw
Robert Kuska added the comment:
This commit (probably) breaks aarch64 python build.
See https://bugzilla.redhat.com/show_bug.cgi?id=1174037
Build was done with libffi 3.1.6, I have also tried with latest upstream libffi
version with same result.
(gdb) b ReturnRect
Function ReturnRect
Changes by Robert Collins robe...@robertcollins.net:
--
nosy: +rbcollins
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12681
___
___
Python-bugs
New submission from Robert Snoeberger:
The documentation for the Py_SetPath API does not indicate if the argument
should point to a wide character array in static storage. However, the
documentation for Py_GetPath says, The returned string points into static
storage; the caller should
Robert Collins added the comment:
I'll put something together.
--
nosy: +rbcollins
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17911
Robert Kuska added the comment:
FYI fedora (rawhide) has SSLv3 disabled in SSLv23 method of openssl package.
http://pkgs.fedoraproject.org/cgit/openssl.git/commit/?id=80b5477597e9f0d9fababd854adfb4988b37efd5
This looks like the same approach as in attached issue22638.diff.
--
nosy
New submission from Robert Collins:
From https://github.com/testing-cabal/testtools/issues/111 - any code that is
data dependent can be hard to diagnose from a backtrace alone. Many unittest
and server environments address this by doing custom tracebacks that include
locals.
To address
Changes by Robert Collins robe...@robertcollins.net:
--
type: - enhancement
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22936
___
___
Python
New submission from Robert Collins:
From https://github.com/testing-cabal/testtools/issues/111 - any code that is
data dependent can be hard to diagnose from a backtrace alone. Many unittest
and server environments address this by doing custom tracebacks that include
locals.
To address
Robert Collins added the comment:
See http://bugs.python.org/issue22936 for the unittest aspect of this.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22936
New submission from Robert Collins:
TestProgram leaves defaultTestLoader.errors dirty. This primarily affects tests
but it would be good hygiene to clear it at the end of TestProgram.
--
components: Library (Lib)
messages: 231261
nosy: rbcollins
priority: normal
severity: normal
status
Robert Collins added the comment:
Yes, making customising the output easier is a good thing. One way is to use
e.g. subunit.run (which can work with all unittest versions since 2.6) and
write a custom filter. Or a custom TestResult and TextTestRunner can work too
New submission from Robert Collins:
This is just an ugly/hygiene thing. Since we've never advertised the submodules
as the API, we should be able to fix this by moving main.py to e.g. __main__.py.
--
messages: 231101
nosy: rbcollins
priority: normal
severity: normal
status: open
title
Changes by Robert Collins robe...@robertcollins.net:
--
components: +Library (Lib)
type: - behavior
versions: +Python 3.5
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22858
New submission from Robert Collins:
Before the argparse migration usageExit was invoked and could be extended via
subclasses, but it no longer is. We could delete it (and document it being no
longer accessible) or put some glue in to reinstate it. I think deleting it is
fine, as long as we
Changes by Robert Collins robe...@robertcollins.net:
--
components: +Library (Lib)
type: - behavior
versions: +Python 3.5
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22859
New submission from Robert Collins:
Some users of TestProgram would like to add options (e.g. testtools.run adds
--list and --load-list) but there isn't a clean point to add them without bulk
copying the implementation around.
We likely need some extra extension points as well - one
Changes by Robert Muil robertm...@gmail.com:
--
nosy: +robertmuil
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21724
___
___
Python-bugs-list
Robert Collins added the comment:
https://code.google.com/p/unittest-ext/issues/detail?id=11
I think that the hamcrest inspired matchers stuff may help make this a reality
too. OTOH if we had a clean patch now for the existing asserts that would be
fine too
New submission from Robert Collins:
From https://code.google.com/p/unittest-ext/issues/detail?id=13
The following is incorrect on Windows:
python -m unittest discover -p '*.py'
It should be without the single quotes around the .py:
python -m unittest discover -p *.py
This needs
New submission from Robert Collins:
Unittest doesn't support a test randomisation feature.
Such a feature should support:
- passing in a seed (to allow reproducing the order for debugging)
- preserving the suite hierarchy, to preserve class and module setUp
performance optimisations
New submission from Robert Collins:
If someone has a TestProgram script - e.g. the unit2 script in unittest2,
loading a module in cwd will fail, because the PYTHONPATH doesn't include '.'.
We might want to consider adding cwd to the PYTHONPATH in TestProgram.
From https://code.google.com/p
New submission from Robert Collins:
Unexpected successes cause failures, but we don't output details about them at
the end of the run.
From https://code.google.com/p/unittest-ext/issues/detail?id=22
A complicating factor is that we don't have a backtrace to show - but we may
have captured
Robert Collins added the comment:
See also https://code.google.com/p/unittest-ext/issues/detail?id=27
Sorry, wrong wording of the bug.
I tested this on IronPython 2.6.1 and 2.7.b1. I see the same result as you and
I consider the following wrong or at least misleading:
- [1, Decimal(1
Robert Collins added the comment:
Hmm, so testtools went in a different direction here - the same unification
stuff, but see
https://github.com/testing-cabal/testtools/commit/18bc5741cf277f7a0d601568be6dccacc7b0783c
tl;dr - I think unittest should not prevent this causing the process to exit
Changes by Robert Collins robe...@robertcollins.net:
--
title: Error in setUp not reported as expectedFailure (unittest) - document
(lack of) interaction between @expectedException on a test_method and setUp
___
Python tracker rep...@bugs.python.org
Robert Collins added the comment:
I don't consider the console output of unittest to be a stable interface.
Michael - do you?
Things that want to process unittest should be using the API.
--
nosy: +rbcollins
___
Python tracker rep
Robert Collins added the comment:
I agree. IIRC the windows shell passes the argument as '*.py' rather than as
*.py, so when we glob it we get no files, as no python files end with an
apostrophe.
--
___
Python tracker rep...@bugs.python.org
http
Robert Collins added the comment:
Hi, I'm glad you're interested in this. I very much want to see a
matcher/hamcrest approach rather than a library of assertions per se - because
match-or-except makes layering things harder.
--
___
Python tracker
Robert Collins added the comment:
+1 on a plain function or context manager.
w.r.t. addCleanUp taking a context manager, that could be interesting - perhaps
we'd want a thing where you pass it the context manager, it __enter__'s the
manager and then calls addCleanUp for you
Robert Collins added the comment:
b)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22813
___
___
Python-bugs-list mailing list
Unsubscribe
Robert Collins added the comment:
Its backported in unittest2 0.8.0 which is available on pypi for 2.6+ and 3.2+.
The changes are large enough that I'd hesitate to backport them in cPython
itself.
--
___
Python tracker rep...@bugs.python.org
http
New submission from Robert Collins:
TestProgram uses defaultTestLoader to load tests. Calling discover() on a
TestLoader sets _top_level_dir. Calling discover with no top_level_dir
implictly sets _top_level_dir but only the first time: the second time it is
called with a different start_dir
Changes by Robert Collins robe...@robertcollins.net:
--
components: +Library (Lib)
versions: +Python 3.5
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22811
New submission from Robert Collins:
I did a brownbag fix for my change to issue22457 which exposed a untested
corner case - this issue is for me to come back and add a regression test for
it.
--
messages: 230628
nosy: rbcollins
priority: normal
severity: normal
status: open
title
Robert Collins added the comment:
This was reported as https://code.google.com/p/unittest-ext/issues/detail?id=71
a while back. I think blacklisting FunctionTestCase in TestLoader is entirely
reasonable.
--
___
Python tracker rep...@bugs.python.org
Changes by Robert Collins robe...@robertcollins.net:
Added file: http://bugs.python.org/file37118/issue22457.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22457
New submission from Robert Collins:
test_assertRaises_frames_survival
(unittest2.test.test_assertions.Test_Assertions
Depends on refcount behaviour to pass - adding a gc.collect() before the
weakref checks is sufficient to fix things on pypy.
test_no_exception_leak (unittest2
Robert Collins added the comment:
Herewith a patch. Applied to unittest2 for backport to unbreak its tests on
pypy.
--
keywords: +patch
Added file: http://bugs.python.org/file37072/issue22764.patch
___
Python tracker rep...@bugs.python.org
http
Changes by Robert Collins robe...@robertcollins.net:
--
type: - behavior
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22764
___
___
Python-bugs
Robert Collins added the comment:
Hmm? I must have misunderstood the test. Here's my understanding: the test is
testing that a an object ref only held in the traceback object of the exception
is cleaned up such that it can be collected. In a refcount system that
collection is immediate
Robert Collins added the comment:
I've done some experimentation. Yes, the updated test passes when the
clear_frames call is removed in cPython 3.5
But the original test also passes when clear_frames is not called if one drops
into pdb and steps through, which still fits the symptoms
Changes by Robert Collins robe...@robertcollins.net:
Added file: http://bugs.python.org/file37080/issue22764.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22764
Robert Collins added the comment:
I'll apply the patch monday if there are no further comments before then.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22153
Robert Collins added the comment:
(Pinging for reviews - I'm going to time out and land this early next week if I
can't get a review on it, since this is actually a fairly significant oversight
and I don't want unittest2 to run ahead of the stdlib - that way leads
unmaintainable madness
Robert Collins added the comment:
Oh, one thought - in testtools we split out 'docs for test writers' and 'docs
for framework folk'. That would facilitate getting runTest out of test writers
face while still documenting it appropriately.
Related to that is my ongoing push to split
Changes by Robert Collins robe...@robertcollins.net:
--
title: There is no standard TestCase.runTest implementation - Documentation of
TestCase.runTest is incorrect and confusing
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
New submission from Robert Collins:
The following trivial chain-into-discover load_tests:
def load_tests(loader, tests, pattern):
import os.path
# top level directory cached on loader instance
this_dir = os.path.dirname(__file__)
return loader.discover(start_dir=this_dir, pattern
Robert Collins added the comment:
Updated patch, after other recent conflicting changes.
--
Added file: http://bugs.python.org/file37071/issue22457.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22457
Changes by Robert Collins robe...@robertcollins.net:
--
type: - behavior
versions: +Python 3.5
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22457
Robert Collins added the comment:
runTest is part of the current API. I think if we're going to hide it we should
do so as part of a deprecation path. (I'm +1 on hiding it).
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Changes by Robert Collins robe...@robertcollins.net:
--
nosy: +rbcollins
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21820
___
___
Python-bugs
Robert Collins added the comment:
Constructing test case objects directly is part of the protocol, and its needed
for framework and extension authors.
I've seen folk use runTest, but rarely enough that I think we could deprecate
it. My argument is that while its supported we should be clear
New submission from Robert Collins:
found while backporting unittest fixes.
The current test fails like so:
==
FAIL: testAssertEqualSingleLine (unittest2.test.test_case.Test_TestCase
Robert Collins added the comment:
There's comments in the test above about 'not testing ourself with ourselves' -
but we're testing the rendering of an error case, so its entirely legitimate to
use the same method's success path to check equality
Changes by Robert Collins robe...@robertcollins.net:
--
keywords: +patch
Added file: http://bugs.python.org/file37057/issue22756.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22756
Robert Collins added the comment:
I've updated the patch to try and address the niggling clarity issues from the
review. Please let me know what you think (and if I hear nothing I'll commit it
as-is since the review was still ok).
--
Added file: http://bugs.python.org/file37045
Robert Collins added the comment:
assertions in setUp are fine IMO. But here's the thing. WHat should this code
do?
class Demo(unittest.TestCase):
def setUp(self):
raise Exception('hi')
def test_normal(self):
# this should NOT be covered by expectedFailure
Robert Collins added the comment:
A few thoughts.
Adding a new public symbol seems inappropriate here: this is a performance
issue that is well predictable and we should cater for that (given difflibs
current performance).
I'll note in passing that both bzr and hg have much higher
Robert Collins added the comment:
Just to note that unittest2 tip (unreleased)had michaels proposed fix, which is
different to that here. I'm going to back that out before doing a release,
because they should be harmonisious.
--
nosy: +rbcollins
Robert Collins added the comment:
My take on this, FWIW, is that any methods in the under-test API - setUp,
tearDown, test_* and anything registered via addCleanup should all support the
same protocol as much as possible, whatever it is.
That is, raising a skip in setUp should skip the test
Robert Collins added the comment:
I'd argue for
- An error - its not covered by the decorator.
- An error - the last two are not covered by the decorator.
- An error - the last two are not covered by the decorator.
- An error - the exception isn't a 'failure' [today - we should revisit
Robert Collins added the comment:
Oh, I got a profile from the test case for my own interest.
6615 seconds ..
some highlights that jumped out at me
200010.1270.000 6610.0250.330 difflib.py:868(compare)
which means we're basically using ndiff, which is cubic rather than
Robert Collins added the comment:
Thanks for the review, updated patch here - I'll let this sit for a day or two
for more comments then commit it Monday.
--
Added file: http://bugs.python.org/file37002/issue7559.patch
___
Python tracker rep
Robert Collins added the comment:
Yeah thats nicer. I'll apply that later unless you can.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17401
Robert Collins added the comment:
Showing it only when False would have higher cognitive load. Showing it always
is simple and clear.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17401
Changes by Robert Collins robe...@robertcollins.net:
Removed file: http://bugs.python.org/file36716/issue22457.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22457
Robert Collins added the comment:
Updated patch.
--
Added file: http://bugs.python.org/file36973/issue22457.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22457
Changes by Robert Collins robe...@robertcollins.net:
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17401
Changes by Robert Collins robe...@robertcollins.net:
Added file: http://bugs.python.org/file36974/issue7559.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7559
Robert Collins added the comment:
Patch polished up and updated - ready for review IMO.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7559
Robert Collins added the comment:
I think its worth a note that the stdio streams are constructed specially, even
with the repr improvements.
--
nosy: +rbcollins
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22673
Robert Collins added the comment:
Closing as the fix to the test suite is applied.
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16662
New submission from Robert Collins:
cpython.hg$ make patchcheck
./python ./Tools/scripts/patchcheck.py
Getting the list of files that have been added/changed ... 448 files
Fixing whitespace ... 0 files
Fixing C file whitespace ... 5 files:
Include/patchlevel.h
Modules/_ctypes/callbacks.c
Robert Collins added the comment:
FWIW testtools rejects test suites with duplicate test ids; I'm considering
adding that feature into unittest itself. We'd need an option to make it warn
rather than error I think, but if we did that we wouldn't need a separate
script at all.
--
nosy
Robert Collins added the comment:
FWIW I'd really like to be reducing the TestCase API not extending it -
particularly since there are lots of good convenient ways of doing this already
(not least mock.patch/mock.patch.object).
So I'm -0.5 on adding this, as I don't see it adding value
Robert Collins added the comment:
So this looks like its going to instantly create bugs in programs that use it.
HTTP/1.1 headers are one of:
latin1
MIME encoded (RFC2047)
invalid and working only by accident
HTTP/2 doesn't change this.
An API that encourages folk to encode into utf8
Robert Collins added the comment:
FWIW we probably need to capture the original unaltered URL somewhere, but also
ensure that PATH_INFO is always a relative path.
One should be able to implement a proxy in WSGI (because thats just another
specialised app), and doing that today requires
Robert Collins added the comment:
Oh, also - while its tempting to say that it doesn't matter whether we take the
urls host portion, or the host header or the server name - it does. Deployments
that look like:
LB/Firewall - backend container - WSGI app
are likely to have assumptions within
Robert Collins added the comment:
So I guess the API concern I have is that there are two cases:
- common spec compliant - US-ASCII + RFC2047
- dealing with exceptions - UTF8 or otherwise
The former totally makes sense as a codec, though the current email
implementation of it isn't quite
Robert Collins added the comment:
Fix up the tests patch - tested on windows 7.
--
Added file: http://bugs.python.org/file36713/fix-windows-tests.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16662
Robert Collins added the comment:
bah, wrong extension to trigger review code :)
--
Added file: http://bugs.python.org/file36714/fix-windows-tests.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16662
Changes by Robert Collins robe...@robertcollins.net:
Removed file: http://bugs.python.org/file36713/fix-windows-tests.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16662
New submission from Robert Collins:
The .gitignore file was missing some build products on windows. The attached
patch makes the tree be clean after doing a debug build.
--
files: windows-git-ignore.diff
keywords: patch
messages: 227498
nosy: rbcollins
priority: normal
severity: normal
Robert Collins added the comment:
Updated patch - fixes windows tests for this patch.
--
Added file: http://bugs.python.org/file36716/issue22457.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22457
Robert Collins added the comment:
Right: the existing code stringifies the original exception and creates an
exception object and a closure
def test_thing(self):
raise exception_obj
but that has the stringified original exception.
--
___
Python
Robert Collins added the comment:
This should fix this issue :)
--
keywords: +patch
Added file: http://bugs.python.org/file36694/issue22457.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22457
Robert Collins added the comment:
I've managed to get a windows setup working. Its my mini-vfs which needs to be
Windows aware (because the abs path of /foo is C:\\foo). I'll work up a patch
tomorrowish.
--
___
Python tracker rep...@bugs.python.org
Robert Collins added the comment:
I can certainly write the reporter glue to work with either a string or a full
reference. Note that the existing late-reporting glue captures the import error
into a string, and then raises an exception containing that string - so what
I've done is consistent
New submission from Robert Collins:
python -m unittest discover -t . foo
where foo is a package
will not trigger load_tests in foo/__init__.py.
To reproduce:
mkdir -p demo/tests
cd demo
cat EOF tests/__init__.py
import sys
import os
def load_tests(loader, tests, pattern):
print(HI WE
Robert Collins added the comment:
You may need to apply the patch from http://bugs.python.org/issue19746 first as
well - I was testing with both applied.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7559
Robert Collins added the comment:
This is what I see in my tree:
E
==
ERROR: test_os (unittest.loader.ModuleImportFailure)
--
Traceback (most recent call last
Robert Collins added the comment:
Raced with your comment. Great - and thanks!
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7559
Robert Collins added the comment:
Thanks; I'm still learning how to get the system here to jump appropriately :).
I thought I'd told hg to reset me to trunk...
You are right about the docs. Reading that, I thought it was saying that
errors would have a list of the errors that show up
Robert added the comment:
I'm not sure if this is related or not, but on 3.4.1 I get the following:
print(round(float(3/2)))
2 (as expected)
print(round(float(5/2)))
2 (expected 3, as float should round .5 up)
--
nosy: +fenofonts
___
Python
Robert Collins added the comment:
Thanks for landing this barry, there's a couple quirks with your improvements -
loadTestsFromModule(mod, foo, bar) will raise a TypeError but not warn about
foo the way loadTestsFromModule(mod, foo) will.
Secondly, the TypeError has an off-by-one error in its
Robert Collins added the comment:
OH! One more thing I just spotted, which is that this change causes
non-'discover' unittest test loading to invoke load_tests.
IMO this is the Right Thing - its what I intended when I described the protocol
a few years back, but we should document
Robert Collins added the comment:
Its more than just a docs issue - AFAICT it isn't possible to tell if closefd
is set after the object is created.
The presence of the parameter in the signature is there, but it isn't
documented *where the bulk of the FileIO parameters are* - there are docs
Robert Collins added the comment:
Oh - the the 'open' function docs are fine - they are just a pointer. I was
specifically referring to the class docs around line 513 of Doc/library/io.rst.
Attached is a patch that changes repr to show this attribute and extends the
docs to document
Robert Collins added the comment:
@michael - ah I think I inverted the sense of the old parameter. It was
defaulting True. So - no need to document anything extra:)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16662
601 - 700 of 1065 matches
Mail list logo