Robert Collins added the comment:
Oh, I didn't mean to imply that these are the only options I'd support - just
that these are the things I've thought through and that I think will all work
well... I'm sure there are mo
Change by Robert Collins :
--
versions: +Python 3.9 -Python 3.5
___
Python tracker
<https://bugs.python.org/issue19645>
___
___
Python-bugs-list mailin
Robert Collins added the comment:
Ok so design wise - there is state on the TestCase that influences assertions;
in potentially two ways.
The first way is formatting - the amount of detail shown in long list
comparisons etc.
The second way I don't think we have at the moment
Robert Collins added the comment:
Right now that attribute could be set by each test separately, or even varied
within a test.
TBH I'm not sure that the attribute really should be supported; perhaps
thinking about breaking the API is worth doing.
But - what are we solving for here. T
Robert Collins added the comment:
I think this is strictly redundant with that other ticket and I'm going to
close it. That said, they need access to self.failureException.
https://docs.python.org/3/library/unittest.html#unittest.TestCase.failureException
--
stage: ->
Robert Collins added the comment:
Sorry for the slow reply here;
There are API breaks involved in any decoupling that involves the exception
raising because of the failureException attribute. Something with signalling
that can be adapted by other test suites etc might have merit, but I
Robert Collins added the comment:
Thank you @Eryk
--
___
Python tracker
<https://bugs.python.org/issue36656>
___
___
Python-bugs-list mailing list
Unsubscribe:
Robert Collins added the comment:
I'd like to add a few notes; please do consider Windows interactions here -
Windows does not have the same model for inode replacement that Posix has.
Secondly, I note that the thread model discussed here hasn't been particular
well artic
Robert Collins added the comment:
New changeset b892d3ea468101d35e2fb081002fa693bd86eca9 by Robert Collins
(Jeroen Demeyer) in branch 'master':
bpo-36994: add test for profiling method_descriptor with **kwargs (GH-13461)
https://github.com/python/cpyt
Robert Collins added the comment:
New changeset b892d3ea468101d35e2fb081002fa693bd86eca9 by Robert Collins
(Jeroen Demeyer) in branch 'master':
bpo-36994: add test for profiling method_descriptor with **kwargs (GH-13461)
https://github.com/python/cpyt
Robert Collins added the comment:
I'm reopening this because I don't agree.
I opened the bug because we have evidence that users find the current
documentation confusing. Saying that its not confusing to us doesn't fix the
confusion.
Why should we mention the special case
Robert Collins added the comment:
This is now showing up in end user tools like black:
https://github.com/ambv/black/issues/564
--
nosy: +rbcollins
versions: +Python 3.7, Python 3.8, Python 3.9
___
Python tracker
<https://bugs.python.
Robert Collins added the comment:
Serhiy, thats not a design flaw, its a feature.
in a class hierarchy, setup and teardown ordering is undefined: implementors
can choose whatever order they want to execute in. e.g.
class A(TestCase):
def setUp(self):
super().setUp()
acquire1()
class B
Robert Collins added the comment:
So, I think we're in a local minima here.
As I said earlier, neither the old nor new names really grab me, and I think
everyone has aknowledged that the new name is -at best- confusing. We don't
need *any more discussion* about that. The question
Robert Collins added the comment:
Whats the use for *unittest* - a tool to help folk develop - to run a test
which is only present in sourceless form?
--
___
Python tracker
<https://bugs.python.org/issue32
Robert Collins added the comment:
Oh, and why look for __init__ - in part, because it predates namespace
packages, but also because unlike regular imports unittest will do negative
things like reading the entire filesystem otherwise.
--
___
Python
Robert Collins added the comment:
Re: backporting this. I think backporting to 3.6/3.7 makes a lot of sense -
bugfix and prerelease respectively.
For 2.7, this bug has been around for ages, the patch is small, and I have no
objection - but the RM has already said no, so I guess not happening
Robert Collins added the comment:
We've now spent more time debating the deprecation that we would have saved if
it had been deprecated.
Deprecations cost user good will. Whilst I very much want to delete all
assertions in favour of matchers, which would allow composed symmetry rather
Robert Collins added the comment:
@doug - I don't see how a separate fips module *wouldn't* solve it:
- code that uses md5 in security contexts wouldn't be able to call it from the
fips module, which is the needed outcome
- code that uses md5 and isn't fips compliant wou
Robert Collins added the comment:
A few thoughts;
usedforsecurity=xxx seems awkward: I wouldn't want, as a user of hashlib, to
have to put that in literally every use I make of it.
If I understand the situation correctly, the goal is for both linters, and at
runtime, identification o
Changes by Robert Collins :
--
nosy: +rbcollins
___
Python tracker
<http://bugs.python.org/issue17188>
___
___
Python-bugs-list mailing list
Unsubscribe:
Robert Collins added the comment:
+1 to changing the UI for 3.7 - just noting that if you're machine processing
the output, the TUI isn't an appropriate channel.
--
___
Python tracker
<http://bugs.python.o
Robert Collins added the comment:
Ok, so we need to figure out whether the tests are wrong, or the 'fix' is wrong.
--
___
Python tracker
<http://bugs.python.
Robert Collins added the comment:
I think the patch should either be rejected, or also handle trailing spaces: if
we're taking the RFC definition of whitespace not being structural then we
should also eat trailing space, which will change the check for extra data in
decode to just che
Robert Collins added the comment:
I find details like this extremely useful in the main docs, so please do add
there.
--
___
Python tracker
<http://bugs.python.org/issue25
Robert Collins added the comment:
@Chris - I don't like the idea of making new classes on the fly like that, it
seems more likely to provoke bugs (as type(case) != SomeSpecificClass) anymore
after that, vs just not relying on __str__ directly.
Going back to Michael's proposa
Robert Collins added the comment:
Please add the reproducer as a test case (in test_dict.py I think) - even
though it needs elementree to trigger it is a dict bug :).
I also wonder if there are similar cases lying under other C collections like
list, tuple and set. E.g. list.find() calls obj
Robert Collins added the comment:
Given two (or more) parameters where one is unicode and one is not, upcasting
will occur multiples times in path.join on windows:
- '\\' is str and will cast up safely in all codecs
- the other str (or bytes) parameter will be up
Changes by Robert Collins :
--
nosy: +rbcollins
___
Python tracker
<http://bugs.python.org/issue26240>
___
___
Python-bugs-list mailing list
Unsubscribe:
Robert Collins added the comment:
It is a bugfix, but we should document when it started working using the
version added segment IMO. I think addding this to 3.6 now would be ok.
--
nosy: +rbcollins
___
Python tracker
<http://bugs.python.
Robert Collins added the comment:
I could imagine doing some complex things to let you get at the AttributeError
in this case but *not* when a different descriptor was added to type(a_mock),
but I think it would confusing overall. This might be worth a doc tweak to
cover it?
--
stage
Robert Collins added the comment:
We're poking at this at the kiwipycon sprints
--
nosy: +rbcollins
___
Python tracker
<http://bugs.python.org/issue21254>
___
___
Robert Collins added the comment:
@Ned - any objection to my committing this at this point?
--
nosy: +rbcollins
___
Python tracker
<http://bugs.python.org/issue28
Changes by Robert Collins :
--
stage: patch review -> commit review
___
Python tracker
<http://bugs.python.org/issue28087>
___
___
Python-bugs-list mai
Robert Collins added the comment:
So I think its fine to have a __len__ reporting 4. tuple(..) works via the
iter() call, but thats really just a thunk to keep existing code working, and
so __len__ for the same reason makes sense.
On the documentation issue, yes, updating the docs is
Robert Collins added the comment:
Btw some things to be aware of in addressing this:
- we will need tests that catchable exceptions raised from a setUpModule or
setUpClass cause cleanups already registered to run
- if (and I'd need to check this) setUpModule or setUpClass can nest - I
Robert Collins added the comment:
So, thank you for the patch. However - there's no need for a metaclass here,
and its actively harmful to comprehending the code.
As I suggested earlier, please decouple the cleanups implementation and then
consume it from the two places that it will be n
Robert Collins added the comment:
See http://bugs.python.org/issue28086 - this introduced a regression in the
test suite.
--
nosy: +rbcollins
___
Python tracker
<http://bugs.python.org/issue27
New submission from Robert Collins:
The test.test_getargs2.TupleSubclass test is failing in master. I suspect its a
fastcall fallout.
--
messages: 275879
nosy: rbcollins, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: test.test_getargs2
Robert Collins added the comment:
hmm, can you give me a change to page this in? I'm pretty sure I saw breakage
in external libraries prompting me to add the test and fix. I'd rather not
recause that.
--
___
Python tracker
<http://bu
Robert Collins added the comment:
Chris, I suggested altering assertAlmostEqual in
http://bugs.python.org/issue27198#msg267187 :) - I took your agreement with
that as a good thing and didn't reply because I had nothing more to add.
IMO the status of this issue is as you indicated: you n
Robert Collins added the comment:
There are two related things here.
Firstly, the generator's body will run without the patch (because the wrapping
function has
try:
return decorated(..)
finally:
unpwatch()
Secondly, the wrapping function is itself not a generator, and anything
Robert Collins added the comment:
Once fixed in CPython, we'll put the backport in mock, for folk using older
Python's.
--
versions: -Python 2.7, Python 3.2, Python 3.3, Python 3.4
___
Python tracker
<http://bugs.python.o
Robert Collins added the comment:
Future direction: hamcrest style matchers. You can read more about them in the
context of unittest
https://rbtcollins.wordpress.com/2010/05/10/maintainable-pyunit-test-suites/
and http://testtools.readthedocs.io/en/latest/for-test-authors.html#matchers
Robert Collins added the comment:
I'm fine with these as a mixin - they are all very generic and unambiguously
named. I'd marginally prefer the opt-in mixin over adding them to the base
class.
Ideally they'd be matchers, but since I haven't ported that upstream yet, th
Robert Collins added the comment:
So its a feature of mock that it can mock a module that doesn't exist. And the
semantics of the import system are designed to be very cheap when a module is
already imported - so when 'patchbug.a' is in sys.modules, import will
correctly return
Robert Collins added the comment:
Thanks for proposing this. I really don't want to add new assertions to
unittest, and I certainly don't want to add narrow usage ones like this, nor
ones that are confusingly named (this has nothing to do with files, but 'close'
is a verb
Robert Collins added the comment:
I don't particularly like either name FWIW :) - but sure, we can add a
different name and deprecate assertCountEqual - but before we do anything lets
look up the previous issue where the rename was
Robert Collins added the comment:
LGTM too
--
___
Python tracker
<http://bugs.python.org/issue27063>
___
___
Python-bugs-list mailing list
Unsubscribe:
Robert Collins added the comment:
I've committed a minimal variation - thanks for the patches.
--
resolution: -> fixed
stage: test needed -> resolved
status: open -> closed
___
Python tracker
<http://bugs.pyth
Robert Collins added the comment:
So something like
for line in _state[0]:
yield line
while True:
yield ''
Will probably do it just fine.
--
___
Python tracker
<http://bugs.python.o
Robert Collins added the comment:
Actually, further inspection and a teddybear with Angus Lees uncovers this:
diff --git a/Lib/unittest/test/testmock/testmock.py
b/Lib/unittest/test/testmock/testmock.py
--- a/Lib/unittest/test/testmock/testmock.py
+++ b/Lib/unittest/test/testmock/testmock.py
Robert Collins added the comment:
./python Lib/unittest/test/testmock/testmock.py
..s.
--
Ran 80 tests in 0.180s
OK (skipped=1)
So thats great. I am
Robert Collins added the comment:
Could you please add a test case.
--
nosy: +rbcollins
stage: patch review -> test needed
___
Python tracker
<http://bugs.python.org/issu
Robert Collins added the comment:
You're changing _mock_call but readline is actually implemented in
_readline_side_effect - just changing that should be all thats needed (to deal
with StopIteration). You will however need to fixup the return values since the
test I added is a bit wider
Robert Collins added the comment:
Thanks Yolanda. I've touched up the test a little and run a full test run (make
test) - sadly it fails: there is an explicit test that StopIteration gets
raised if you set it as a side e
Robert Collins added the comment:
Thanks Yolanda, that looks sane - could you perhaps add a test for this in
Lib/unittest/tests/test_mock/ ?
--
___
Python tracker
<http://bugs.python.org/issue26
New submission from Robert Collins:
>>> import unittest.mock
>>> o = unittest.mock.mock_open(read_data="fred")
>>> f = o()
>>> f.read()
'fred'
>>> f.read()
''
>>> f.readlines()
[]
>>> f.readline()
Tra
Changes by Robert Collins :
--
stage: needs patch -> test needed
___
Python tracker
<http://bugs.python.org/issue24959>
___
___
Python-bugs-list mailing list
Un
Robert Collins added the comment:
I'm fairly sure its eating the stack frames because the calling frames are
annotated __unittest__ - its technically a feature :/.
--
title: unittest swallows part of stack trace when raising AssertionError in a
TestCase -> unittest swallows
Robert Collins added the comment:
Yes, it is... ish.
The frame skipping code occurs when we serialise exceptions, and we pass a
limit in. The limit is calculated on the main exception only. If the cause has
a longer exception than the limit we calculated, you'd see this behaviour.
Pro
Robert Collins added the comment:
I think this is a valid mock bug; it likely needs some thoughtful exhaustive
testing, and obviously support added for it.
--
stage: -> test needed
title: unittest.mock does not wrap dict objects correctly -> unittest.mock does
not wrap dunder m
Robert Collins added the comment:
The basic model is this:
- a test can have a single outcome [yes, the api is ambiguous, but there it is]
- subtests let you identify multiple variations of a single test (note the id
tweak etc) and *may* be reported differently
We certainly must not report
Robert Collins added the comment:
sih4sing5hong5 - I think we do need a test in fact - it can be done using
mocks, but right now I think the patch has a bug - it looks for isidentifier on
$thing.py, but not on just $thing (which we need to do to handle packages, vs
modules
Robert Collins added the comment:
Thanks for the patch; the test may be redundant but not enough to matter for
now - and the bug really doth need fixing, so I've applied it as-is.
--
resolution: -> fixed
stage: patch review -> resolved
status: ope
Robert Collins added the comment:
So this test script is making a 65K entry dict, and each item is a new,
separate 65K string. The strings are allocated in single chunks, so we should
expect couple hundred reference count writes total.
AIUI involuntary context switches occur when there is
Robert Collins added the comment:
@serhiy, how is that different to what I said?
--
___
Python tracker
<http://bugs.python.org/issue25783>
___
___
Python-bug
Robert Collins added the comment:
I don't think we make any guarantees for or against references, but - we
attempt to free references already (see how we call clear_frames), so this is a
bug, pure and simple.
--
___
Python tracker
Robert Collins added the comment:
Hmm, this is a little surprising, but - why are you raising AssertionError like
that - thats what assertRaises is for.
--
stage: -> needs patch
___
Python tracker
<http://bugs.python.org/issu
Robert Collins added the comment:
The context manager errors if *nothing* matches, not if *everything* matches,
which is very different to catch_warnings because the filters are used to
*exclude* warnings, and excess warnings are errors there.
Because of that, there's little if any reas
Robert Collins added the comment:
@Serhiy care to commit it?
--
___
Python tracker
<http://bugs.python.org/issue20556>
___
___
Python-bugs-list mailing list
Unsub
Robert Collins added the comment:
What version of python are you testing with? unittest 2.7 has a number of bugs
vis-a-vis namespaces and discovery. If you're testing with less than 3.5, or
perhaps 3.6, please try with unittest2, which has the same fixes as the stdlib
uni
Robert Collins added the comment:
Can we just stop running the test suite directly?
python -m unittest test.test_traceback
should work fine and as quickly, ... I'd like to delete all the __main__ in the
test suite as cruft TBH.
The patch would be ok if ugly, its a bit of a magic number
Robert Collins added the comment:
Hmm, I haven't looked closely, but some high level thoughts.
I'm worried about making mock too complex here. We already say folk should use
a VFS for complex file based tests, and there's quite a chunk of code you're
adding - perhaps bett
Robert Collins added the comment:
Thanks for the patch; reviewed in rietvald.
--
___
Python tracker
<http://bugs.python.org/issue24780>
___
___
Python-bugs-list m
Robert Collins added the comment:
The new output seems ok to me?
--
___
Python tracker
<http://bugs.python.org/issue19217>
___
___
Python-bugs-list mailin
Robert Collins added the comment:
I think we should close this again: if you subclass something you need to
implement the full public API. raw has been in that API since 2010!.
It's a shame that folk have been implementing just-enough, rather than the
actual API, but I don't see th
Robert Collins added the comment:
@mbussonn - I don't see an updated non-tty-checking patch from you?
--
___
Python tracker
<http://bugs.python.org/is
Robert Collins added the comment:
Sorry, I missed the little footnote on case 4 about still supporting
source-less distributions. I guess in that context we do still need to support
this.
However - please check that this does indeed happen on Python master - 3.6.
unittest does evolve and if
Robert Collins added the comment:
Python has stopped supporting .pyc-only distributions - see
https://www.python.org/dev/peps/pep-3147/#case-3-pycache-foo-magic-pyc-with-no-source
- and so, while what you are seeing is inconsistent with import in some older
python's, it is not a bug in
Robert Collins added the comment:
I'd rather make this super simple: just terminate the test run immediately. We
can catch KeyBoardInterrupt in the UI layer to still permit outputting summary
information. That removes one more source of global state that makes testing
fr
Robert Collins added the comment:
So in general:
https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/System-Type.html#System-Type
and
https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Hosts-and-Cross_002dCompilation.html
There are three platforms in play
Robert Collins added the comment:
@Martin I was wrong re: the defs - they only cover function vs data, not return
codes. So it looks fine to me.
--
___
Python tracker
<http://bugs.python.org/issue5
Robert Collins added the comment:
@Serhiy, EXIT_FAILURE is used in Python's C code itself (just once admittedly,
and then we use 0 sometimes for success and sometimes for errors, and then 1
for errors... aiee.)
FWIW to the extent that folk want to write posix code in Python, I'
Robert Collins added the comment:
The fix is appropriate (we might want to think about symlinks in the future).
I'd very much like a test for it (in Lib/unittest/test/test_discovery.py) and
it should be applied to 3.5, master - older versions had this wrapped up in
simpler code and won
Robert Collins added the comment:
LGTM too.
--
___
Python tracker
<http://bugs.python.org/issue25111>
___
___
Python-bugs-list mailing list
Unsubscribe:
Robert Collins added the comment:
wouldn't changing walk_stack to add one more f_back be better? Seems odd to
work around it...
--
___
Python tracker
<http://bugs.python.org/is
Robert Collins added the comment:
Hmm, I think we can fix this. Its leaking due to the use of a helper I think.
So - we should just fix this [and add a test, since clearly the test coverage
is insufficient]
--
___
Python tracker
<h
Robert Collins added the comment:
It seems to me that how, and when, Python exits the process is important to
folk who will never ever touch the C API.
--
___
Python tracker
<http://bugs.python.org/issue5
Robert Collins added the comment:
Here are some options.
a) Don't make the new thing public - instead export within Python.exe the
existing private symbol _...withNames. Pros: no change to public API. Cons:
extension modules using the public API cannot make these sorts of errors
cleare
Changes by Robert Collins :
--
resolution: -> fixed
stage: commit review -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.or
Robert Collins added the comment:
2.7 is sufficiently different that I haven't backported this there - plus the
report said it was introduced in 3.4. If someone can show this doesn't work in
2.7 and also supply a patch, we could appl
Robert Collins added the comment:
Right. So I think one could also propose that the default exception handling
should also change to this new number, but it is a different situation -
programs don't conflict with that - they allow it to bubble up, but this
situation is outside its co
Robert Collins added the comment:
def main():
try:
thing()
except SomethingChanged:
exit(1)
except BinaryDiff:
exit(2)
except:
exit(3)
This is the sort of pattern e.g. 'diff' has.
Should exit(3) there become exit(1) ? exit(1) means 'succ
Changes by Robert Collins :
--
stage: patch review -> commit review
___
Python tracker
<http://bugs.python.org/issue21112>
___
___
Python-bugs-list mai
Changes by Robert Collins :
--
stage: patch review -> commit review
___
Python tracker
<http://bugs.python.org/issue23183>
___
___
Python-bugs-list mai
Changes by Robert Collins :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.6 -Python 3.5
___
Python tracker
<http://bugs.python.or
Robert Collins added the comment:
This itself is fixed.
--
resolution: -> fixed
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.or
Robert Collins added the comment:
@ezio - you seem busy, so I'll commit this next week if its still pending.
--
___
Python tracker
<http://bugs.python.org/is
Robert Collins added the comment:
Forgot docs - I'll do before committing, but not worried about review of them
so much.
--
___
Python tracker
<http://bugs.python.org/i
1 - 100 of 542 matches
Mail list logo