[issue44923] Unittest incorrect result with argparse.ArgumentError in self asserRaises context

2021-08-16 Thread Troulet-lambert Odile


New submission from Troulet-lambert Odile :

When passed an Argparse.ArgumentError in the self.assertRaises context 
uniittest does not recognize the exception and raises an exception.
As a consequence the test fails whereas it should pass

--
components: Tests
files: bug_unittest_exception.py
messages: 399640
nosy: piscvau
priority: normal
severity: normal
status: open
title: Unittest incorrect result with argparse.ArgumentError in self 
asserRaises context
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file50222/bug_unittest_exception.py

___
Python tracker 
<https://bugs.python.org/issue44923>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38763] mock with side effect : assert_called_once returns None while call_count returns 1

2019-11-10 Thread Troulet-lambert Odile


New submission from Troulet-lambert Odile :

Using a mock with side_effect, I would expect that assert_called_once returns 
True if the mock has been called.
Yet it returns None while call_count== 1 returns True.

If this is not a bug, I would welcome some explanation in the documentation.

--
components: Tests
files: bugmock.tar
messages: 356341
nosy: piscvau
priority: normal
severity: normal
status: open
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48706/bugmock.tar

___
Python tracker 
<https://bugs.python.org/issue38763>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38757] mocking an exception, arguments do not seem to be passed to the mock

2019-11-09 Thread Troulet-lambert Odile


New submission from Troulet-lambert Odile :

When patching an Exception with a side_effect to another exception, it seems 
like the exceiption arguments are not passed to the mock.

--
components: Tests
files: essai mock_exception.py
messages: 356305
nosy: piscvau
priority: normal
severity: normal
status: open
title: mocking an exception, arguments do not seem to be passed to the mock
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file48704/essai mock_exception.py

___
Python tracker 
<https://bugs.python.org/issue38757>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com