Michael Foord added the comment:
See issue 10548. There is some resistance to expectedFailure masking errors in
setUp/tearDown as these aren't the place where you would normally expect the
expected failure...
--
___
Python tracker
Michael Foord added the comment:
I think Twisted uses the tearDown to fail tests as well. As we have two use
cases perhaps we should allow expectedFailure to work with failues in tearDown?
(And if we do that it should cover setUp as well for symmetry or it becomes a
morass of special cases
Michael Foord added the comment:
Well, it would be nice for the Python test suite, maybe not so useful for
external users of the api. Something for regrtest rather than unittest I think.
--
___
Python tracker
<http://bugs.python.org/issue12
Michael Foord added the comment:
On OS X Lion, with XCode 4.2 installed, I find the following works (no need to
install macports):
./configure CC=gcc-4.2 --prefix=/dev/null --with-pydebug
--
nosy: +michael.foord
___
Python tracker
<h
Michael Foord added the comment:
Ah, it seems I have XCode 3.2.6 installed alongside XCode 4.2.
--
___
Python tracker
<http://bugs.python.org/issue13241>
___
___
Changes by Michael Foord :
--
nosy: -michael.foord
___
Python tracker
<http://bugs.python.org/issue11812>
___
___
Python-bugs-list mailing list
Unsubscribe:
Michael Foord added the comment:
I think your proposed workaround is good enough and no extra effort to type
than the suggested change to assertIsInstance.
-1 on a new method
I think the behaviour of isinstance is clear enough that people who
misunderstand what assertIsInstance is doing
Michael Foord added the comment:
Note that this works for me on a Macbook Air that has never had Snow Leopard,
nor XCode 3 installed.
As far as I can tell non-llvm gcc *is* installed by XCode 4.2: /usr/bin/gcc-4.2
--
___
Python tracker
<h
Changes by Michael Foord :
--
nosy: -michael.foord
versions: +Python 3.3 -Python 3.2
___
Python tracker
<http://bugs.python.org/issue10278>
___
___
Python-bug
New submission from Michael Foord :
Where os.listdir encounters undecodable bytes from the filesystem it uses the
surrogateescape handler. As the resulting strings are invalid they can't be
encoded without an errorhandler, and so can't be printed (for example).
This should be
Michael Foord added the comment:
I'd like to commit this patch. What's your real name Trundle, for the NEWS
entry?
--
assignee: -> michael.foord
___
Python tracker
<http://bugs.pytho
Michael Foord added the comment:
No longer reproducable on CPython. Unfortunately still an issue with unittest2.
--
resolution: -> out of date
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
Changes by Michael Foord :
--
resolution: -> invalid
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue11764>
___
___
Python-bugs-list
Michael Foord added the comment:
Andreas, is this still needed and valid?
--
assignee: -> michael.foord
___
Python tracker
<http://bugs.python.org/issu
Michael Foord added the comment:
traceback patch looks good. Thanks for the unittest2 patch as well.
--
___
Python tracker
<http://bugs.python.org/issue8
Michael Foord added the comment:
Thanks
--
resolution: -> duplicate
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue13675>
___
___
New submission from Michael Foord :
Reported by a user. Reported on Windows but probably not Windows specific.
If IDLE doesn't have permission to read the recent-files.lst file then it
crashes. (When launched with pythonw.exe on Windows it silently fails to open
with no error message t
New submission from Michael Foord :
Implementing a custom __dir__ method is fiddly because there is no way of
obtaining the standard list of attributes that dir would return.
Moving the relevant parts of the dir implementation into object.__dir__ would
allow a custom __dir__ to obtain the
Michael Foord added the comment:
Sure, let's do it. Fabio, care to provide patch with tests and doc changes?
(For 3.3.)
--
___
Python tracker
<http://bugs.python.org/is
Michael Foord added the comment:
Unless Terry wants to contribute a fix I suggest closing this.
--
___
Python tracker
<http://bugs.python.org/issue11906>
___
___
Michael Foord added the comment:
> Interactive mode is an approved method of running Python code, along with
> batch mode.
That is not guaranteed for any particular piece of Python code in the standard
library. In particular it is not amenable to test automation, so it is
certainly
Michael Foord added the comment:
> it should run interactively as documented.
Where is it documented that all tests will run from the IDLE prompt?
I have *never* heard this claim before. I have nothing against tests supporting
this, but those who want it to happen will have to do the w
Michael Foord added the comment:
Config options are for when developers can't make decisions. Given that there
are valid use cases please just allow it. A --strict option is fine... (but
no-one will use it I suspect)
--
___
Python tracker
Changes by Michael Foord :
--
assignee: -> michael.foord
___
Python tracker
<http://bugs.python.org/issue11218>
___
___
Python-bugs-list mailing list
Unsubscri
Michael Foord added the comment:
Yes, allowing it by default. :-)
--
___
Python tracker
<http://bugs.python.org/issue10530>
___
___
Python-bugs-list mailin
Michael Foord added the comment:
I don't think this is something that belongs in unittest - it's not something
particularly useful (or at least particularly requested) outside of the python
test suite. No reason that a WatchfulTestRunner couldn't l
Changes by Michael Foord :
--
nosy: +michael.foord
___
Python tracker
<http://bugs.python.org/issue12341>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Michael Foord :
In Python 3 the following code prints "False" because the use of super() has
caused the __class__ descriptor to be omitted from the class namespace. Remove
the use of super and it prints "True".
class X(object):
def __init__(
Michael Foord added the comment:
The basic idea of the patch is good, but instead of introducing _MAX_LENGTH,
maxDiff should be reused.
--
___
Python tracker
<http://bugs.python.org/issue11
Michael Foord added the comment:
Sorry, ignore that. I see that the patch already passes maxDiff to truncate_str.
--
___
Python tracker
<http://bugs.python.org/issue11
Michael Foord added the comment:
I have a feeling I added the arguments to TestResult.__init__ to allow it to be
used as a silent test result directly in place of TextTestResult. I still need
to check this.
Not adding the arguments to the super call in TextTestResult would have been an
Changes by Michael Foord :
--
assignee: -> michael.foord
___
Python tracker
<http://bugs.python.org/issue12376>
___
___
Python-bugs-list mailing list
Unsubscri
Michael Foord added the comment:
Wondered if you guys had heard of some recent advances in the state of the art
in this field. I'm sure you have, but thought I'd link it here anywhere.
Quote taken from this article (which links to relevant papers):
http://www.serpentine.com/blog/
Michael Foord added the comment:
Doesn't seem like an unreasonable request. Nick / Benjamin, what do you think?
--
___
Python tracker
<http://bugs.python.org/i
Michael Foord added the comment:
I can produce a patch w/ tests and documentation for you to review Nick.
--
___
Python tracker
<http://bugs.python.org/issue8
Michael Foord added the comment:
It isn't clear to me exactly what fix you are suggesting for Python 2.7?
--
assignee: -> michael.foord
___
Python tracker
<http://bugs.python.org
Michael Foord added the comment:
My thinking on this has evolved a bit. Changing an import error into an
attribute error is just a bad api. We should just fix the bad api.
--
___
Python tracker
<http://bugs.python.org/issue7
Michael Foord added the comment:
I wouldn't object to having a cyclic reference test for TestCase, although if
it ever becomes a problem for the development of unittest we may have to
disable it again. I think Benjamin said he would like to modify the test from
Martin
Michael Foord added the comment:
*If* we add this to unittest then we need to decide between test load time
parameterised tests and test run time parameterisation.
Load time is more backwards compatible / easier (all tests can be generated at
load time and the number of tests can be known
Michael Foord added the comment:
And yes, parameterising test cases is a different issue. bzr does this IIRC.
This is easier in some ways, and can be done through load_tests, or any other
test load time mechanism.
--
___
Python tracker
<h
Michael Foord added the comment:
Test selection would require load time parameterisation - although the current
test selection mechanism is through importing which would probably *not* work
without a specific fix. Same for run time parameterisation.
Well how *exactly* you generate the names
Michael Foord added the comment:
Dammit, I've reversed my thinking in some of those messages. Load time
parameterisation *does* give you separate test reporting. It is run time
parameterisation that doesn't.
Depending on how you do it (i.e. if the decorator generates the tests and
Michael Foord added the comment:
So if we do import time *or* test load time parameterisation then we can do
separate failure reporting. We may still want to improve "test selection" for
parameterised tests.
There are use cases for run time parameterisation (for example genera
Michael Foord added the comment:
That all sounds good to me Nick. Some notes / questions.
How should parameterised tests be marked? I'm happy with a
unittest.parameterized decorator (it would do no work other than mark the test
method, with the parameterisation being done in the TestL
Michael Foord added the comment:
Oh, and if we're not going to get clever with naming, how is the TestResult
going to include the parameter repr in the failure report? That information
will have to be stored on the TestCase.
I would prefer this feature not to touch the TestResult - s
Michael Foord added the comment:
Well, pyflakes will tell you about name clashes within a TestCase (unless
you're shadowing a test on a base class which I guess is rarely the case)...
When we generate the tests we could add the parameter reprs to the docstring. A
decorator factor that
Michael Foord added the comment:
Note that name clashes *would* result in non-unique testcase ids, so we need to
prevent that.
--
___
Python tracker
<http://bugs.python.org/issue7
Michael Foord added the comment:
Yeah, without some clear advantages and a clean api / implementation I'm -1.
--
___
Python tracker
<http://bugs.python.org/is
Michael Foord added the comment:
David, I don't understand - it looks like Nick's suggestion would allow you to
create a name per case, that's the point of it!
You could even do this:
def _name_from_case(name, cases):
for idx, case in enumerate(cases, start=1):
tes
Changes by Michael Foord :
--
nosy: -michael.foord
___
Python tracker
<http://bugs.python.org/issue11610>
___
___
Python-bugs-list mailing list
Unsubscribe:
Michael Foord added the comment:
Having a "TestCase factory" would be pretty easy, and solve the scaling
problems.
For example:
def make_testcase_classes():
for backend in backends:
yield type(
'{}Test'.format(backend.name),
Michael Foord added the comment:
I love the functionality. Running individual tests (or groups of tests) with
unittest is a *pain*. I had hoped to solve this through unittest extensions,
but this is taking me longer to get to than I had hoped.
So I would like to add this to unittest, but
Michael Foord added the comment:
I agree with Antoine, as test.support is not a public api adding new features
to assist with debugging is fine.
--
___
Python tracker
<http://bugs.python.org/issue12
Michael Foord added the comment:
Right. For a callable object (instance with __call__ method), it's unambiguous
which signature you want. For a class it's ambiguous.
--
___
Python tracker
<http://bugs.python.
Michael Foord added the comment:
Well, expectedFailure could dispatch on the type of the argument, with
different behaviour for strings and anything else (presumed to be a function /
method). That would be inconsistent with the api for skipping though. (I'm not
wild on the message arg
Michael Foord added the comment:
Output below, first without DISTUTILS_DEBUG (showing the not very useful
default message) and second with. (The actual exception is "Access to the path
'C:\Program Files\IronPython 2.7\Lib\site-packages\mock.py' is denied.")
This is w
Michael Foord added the comment:
We aren't talking about *removing* these methods from unittest - but now that
we have standardised on assertEqual for the Python test suite it is annoying
(particularly for Ezio who changes) when *new* tests are checked in using the
old (deprecated-bu
Changes by Michael Foord :
--
title: deprecate unittest.TestCase.assertEquals -> Disable
unittest.TestCase.assertEquals and assert_ during a regrtest run
___
Python tracker
<http://bugs.python.org/iss
Michael Foord added the comment:
Well, there is *some* value in stylistic consistency. If it didn't matter at
all then Guido wouldn't have instigated the deprecation of assertEquals and
assert_ and standardised on assertEqual (which he did during the sprints at
PyCon 2009). Eithe
Michael Foord added the comment:
If you want the exception then use assertRaises in a with statement. The
exception is available as an attribute on the context manager.
--
resolution: -> rejected
stage: -> committed/rejected
status: open -&g
Michael Foord added the comment:
Sorry, it's a reopened bug requesting a feature that has already been
considered and rejected previously. Yes I was abrupt, my apologies - I'm trying
to clear my backlog before I go away.
--
___
Pyth
Michael Foord added the comment:
It would be nice to settle this.
Personally I would like to see the defaults being:
Linux: ~/.pythonx.y
Mac OS X: ~/.pythonx.y with a fallback of ~/Library/Preferences/.pythonx.y
Windows: ~/pythonx.y perhaps with a backup of AppData/pythonx.y
For both Windows
Michael Foord added the comment:
The "None" error message *looks* to me like the result of a failed assertion.
That may not be correct of course...
--
___
Python tracker
<http://bugs.python.
Michael Foord added the comment:
Providing access to the exception on the context manager was *precisely* to
meet the use case of wanting to make assertions about the exception. I tend to
agree with Guido that having one of the asserts return something is a bit odd,
but irrespective of that
Michael Foord added the comment:
Well, it was misdiagnosed yes - but asking for "python -m unittest ..." support
in Python 2.6 is still a feature request and not a bug report. (So
unfortunately it can't be fixed in 2.6 which is bugfix only. The solution is to
use unittest
New submission from Michael Foord :
As discussed on python-dev, a version of getattr that does static lookups -
bypassing the descriptor protocol, __getattr__, and __getattribute__. Initial
implementation by Nick Coghlan, amended and tests added by me.
Phillip Eby objects to this code
Michael Foord added the comment:
Tests require Python 3. Implementation works with Python 2 as well.
--
Added file: http://bugs.python.org/file18700/test_static.py
___
Python tracker
<http://bugs.python.org/issue9
Changes by Michael Foord :
Removed file: http://bugs.python.org/file18700/test_static.py
___
Python tracker
<http://bugs.python.org/issue9732>
___
___
Python-bugs-list m
Changes by Michael Foord :
--
Removed message: http://bugs.python.org/msg115297
___
Python tracker
<http://bugs.python.org/issue9732>
___
___
Python-bugs-list m
Michael Foord added the comment:
Tests require Python 3. Implementation works with Python 2 as well.
--
Added file: http://bugs.python.org/file18701/test_static.py
___
Python tracker
<http://bugs.python.org/issue9
Changes by Michael Foord :
--
Removed message: http://bugs.python.org/msg115296
___
Python tracker
<http://bugs.python.org/issue9732>
___
___
Python-bugs-list m
Michael Foord added the comment:
(Reposted as text was entirely duplicated - oops.)
As discussed on python-dev, a version of getattr that does static lookups -
bypassing the descriptor protocol, __getattr__, and __getattribute__. Initial
implementation by Nick Coghlan, amended and tests
Michael Foord added the comment:
Since the addition of __dir__, dir(obj) can return arbitrary values. Typically
(I guess) this will be used to add dynamically created attributes that this
function will fail to find - so it is *more* likely that we will fail to find
something in dir than the
Michael Foord added the comment:
(Or vice versa - getattr_static may succeed in finding members - like
descriptors that raise AttributeError when fetched - when getattr fails.)
--
___
Python tracker
<http://bugs.python.org/issue9
Michael Foord added the comment:
+1
--
___
Python tracker
<http://bugs.python.org/issue9754>
___
___
Python-bugs-list mailing list
Unsubscribe:
http://mail.pyth
Michael Foord added the comment:
(Note that in general I am against extending the TestCase API with more asserts
given how wide it is and how much it has expanded in recent versions. I've
written warning checking code enough times for third party projects that I
think this is worth it t
Michael Foord added the comment:
Why not accepting a tuple of warnings? That doesn't make sense for
assertWarnsRegexp of course.
--
___
Python tracker
<http://bugs.python.org/i
Michael Foord added the comment:
This has been on my 'todo list' for a long time. Feel free to get to it before
me. Please *don't* include the now deprecated assert* methods in the table. I'd
like to move all the deprecated methods to a separate section of the
documentati
Changes by Michael Foord :
--
nosy: -michael.foord
___
Python tracker
<http://bugs.python.org/issue9831>
___
___
Python-bugs-list mailing list
Unsubscribe:
Michael Foord added the comment:
Interesting use case.
If the test has not yet failed this is fine. The problem is that if an
exception has *already* been raised then it will already have been added to the
result - so by then skipping is meaningless (or contradictory - the test can
fail
Michael Foord added the comment:
It is relevant and would be *possible* to implement. I'm not 100% convinced it
is a good *enough* idea to make it worth adding though. I'd like to leave the
issue open for the moment in case other people want
Michael Foord added the comment:
unittest *can't* know which setUp methods have already been called if an error
occurs in one of them (because they are called explicitly by the sub-classes
and not by unittest itself). Given this, the specific fix suggested seems
Michael Foord added the comment:
Destructors are special cased in many languages and tearDown is not a
destructor. More importantly though the change you suggest would be backwards
incompatible.
The 'correct' way to do this in new code is to use cleanUp functions which
*are* call
Michael Foord added the comment:
Right, _wrapped_run is private and not intended to be overridden.
Perhaps slightly ironically (for this particular bug report) is that the change
was introduced to support class and module level setUp and tearDown (similar to
the use-case it now blocks
Michael Foord added the comment:
Hmmm... 2.7 has already been released and has the same issue, so 'drastic'
changes (like renaming BaseTestSuite back to TestSuite) are probably out.
--
components: +Library (Lib)
versions: +Python 2.7
Michael Foord added the comment:
Ok, so here is an idea that could remove the need for TestSuite._wrapped_run.
TestSuite.run could "tag" the result object (set an attribute). Nested
TestSuites would see an already tagged suite and do nothing (beyond running
tests of course). The
Michael Foord added the comment:
On 24/09/2010 19:23, Martin v. Löwis wrote:
> Martin v. Löwis added the comment:
>> Perhaps slightly ironically (for this particular bug report) is that
>> the change was introduced to support class and module level setUp and
>> tearDow
Michael Foord added the comment:
The attached patch fixes the issue (I think...) by tagging the result object.
It removes the need for _wrapped_result altogether. The test fails without the
change to TestSuite and passes with the change.
This could be applied to 2.7-maint and py3k.
Uhm
Michael Foord added the comment:
When I run with -OO I get 42 test failures. Most of them look like they are due
to missing docstrings but some are likely to be due to missing asserts.
42 tests failed:
test_bisect test_cmd test_code test_collections test_compileall
test_ctypes
Michael Foord added the comment:
Most of those failures look like they have a similar cause (not all of them
though) related to running doctests. When issue 6292 was closed all tests
passed with -OO, so this is a regression. I'm raising a separate issue for
that.
Looking at the
New submission from Michael Foord :
When I run the test suite (py3k branch) with -OO I get 42 failures. Most of
these look like they are caused by the same (or a similar) problem (attempting
to run doctests from now-non-existent docstrings).
The tests that fail are:
When I run with -OO I get
Michael Foord added the comment:
Cool - although I *do* see failures under -O; test_import for example. That one
is a __pycache__ test, so barry's fault I think.
I'll detail the failures in issue 9964 as I think *most* of them are caused by
a problem with pdb.py
In fact, if you
Changes by Michael Foord :
Removed file: http://bugs.python.org/file19035/pdb.diff
___
Python tracker
<http://bugs.python.org/issue9082>
___
___
Python-bugs-list mailin
Michael Foord added the comment:
Oops. The patch should go to issue 9964. Sorry for all this noise.
--
___
Python tracker
<http://bugs.python.org/issue9
Michael Foord added the comment:
Most of the failures are caused by a problem in pdb.
In fact, if you run Python with -OO you can't even *import* pdb.
The attached patch fixes that problem (a hasty and untested patch though), and
that reduces the number of failures to 5:
5 tests f
Changes by Michael Foord :
--
nosy: +michael.foord
___
Python tracker
<http://bugs.python.org/issue9969>
___
___
Python-bugs-list mailing list
Unsubscribe:
Michael Foord added the comment:
Note from Nick Coghlan from the Python-dev discussion:
A very quick scan of _tokenize suggests it is designed to support
detect_encoding returning None to indicate the line iterator will
return already decoded lines. This is confirmed by the fact the
standard
Changes by Michael Foord :
--
assignee: -> michael.foord
components: +Library (Lib)
versions: +Python 3.2
___
Python tracker
<http://bugs.python.org/iss
Changes by Michael Foord :
--
assignee: -> michael.foord
components: +Library (Lib)
versions: +Python 3.2
___
Python tracker
<http://bugs.python.org/iss
Michael Foord added the comment:
+1
Looks like a reasonable use case.
--
nosy: +michael.foord, ncoghlan
___
Python tracker
<http://bugs.python.org/issue10
1 - 100 of 1077 matches
Mail list logo