Commit Graph

196 Commits

Author SHA1 Message Date
Martin Panter d2ad5718ad Issue #25523: Further a-to-an corrections new in 3.5 2015-11-02 04:20:33 +00:00
Berker Peksag 29bf4d403d Issue #24857: Comparing call_args to a long sequence now correctly returns a
boolean result instead of raising an exception.

Patch by A Kaptur.
2015-09-09 23:39:45 +03:00
Berker Peksag 3fc536f1c9 Issue #24857: Comparing call_args to a long sequence now correctly returns a
boolean result instead of raising an exception.

Patch by A Kaptur.
2015-09-09 23:35:25 +03:00
Robert Collins 079fc7faff Issue #21112: Fix regression in unittest.expectedFailure on subclasses.
Patch from Berker Peksag.
2015-08-28 10:35:14 +12:00
Robert Collins ed599b7c84 Issue #21112: Fix regression in unittest.expectedFailure on subclasses.
Patch from Berker Peksag.
2015-08-28 10:34:51 +12:00
Robert Collins be6caca534 Issue #20362: Honour TestCase.longMessage correctly in assertRegex.
Patch from Ilia Kurenkov.
2015-08-20 11:13:09 +12:00
Berker Peksag 86b34da5ef Issue #23004: mock_open() now reads binary data correctly when the type of read_data is bytes.
Initial patch by Aaron Hill.
2015-08-06 13:15:51 +03:00
Robert Collins ca647ef60a Issue #21750: Further fixup to be styled like other mock APIs. 2015-07-24 03:48:20 +12:00
Robert Collins 5329aaa74b Issue #21750: mock_open.read_data can now be read from each instance, as it
could in Python 3.3.
2015-07-17 20:08:45 +12:00
Robert Collins b37f43f94b - Issue #18622: unittest.mock.mock_open().reset_mock would recurse infinitely.
Patch from Nicola Palumbo and Laurent De Buyst.
2015-07-15 11:42:28 +12:00
Berker Peksag abfaecdfdd Issue #23004: mock_open() now reads binary data correctly when the type of read_data is bytes.
Initial patch by Aaron Hill.
2015-08-06 13:16:52 +03:00
Robert Collins 88ba360c88 Issue #21750: Further fixup to be styled like other mock APIs. 2015-07-24 03:48:45 +12:00
Robert Collins 4838717b53 Issue #21750: mock_open.read_data can now be read from each instance, as it
could in Python 3.3.
2015-07-17 20:10:23 +12:00
Robert Collins 76d508b5d4 - Issue #18622: unittest.mock.mock_open().reset_mock would recurse infinitely.
Patch from Nicola Palumbo and Laurent De Buyst.
2015-07-15 11:49:43 +12:00
Robert Collins f58f88c4c7 Issue #23661: unittest.mock side_effects can now be exceptions again.
This was a regression vs Python 3.4. Patch from Ignacio Rossi
2015-07-14 13:51:40 +12:00
Serhiy Storchaka 041dd8eef1 Issue #15836: assertRaises(), assertRaisesRegex(), assertWarns() and
assertWarnsRegex() assertments now check the type of the first argument
to prevent possible user error.  Based on patch by Daniel Wagner-Hall.
2015-05-21 20:15:40 +03:00
Serhiy Storchaka e98209c2b4 Issue #24245: Eliminated senseless expect clauses that have no any effect.
Patch by Martin Panter.
2015-05-20 16:10:04 +03:00
Serhiy Storchaka df573d6ad8 Issue #24134: assertRaises(), assertRaisesRegex(), assertWarns() and
assertWarnsRegex() checks now emits a deprecation warning when callable is
None or keyword arguments except msg is passed in the context manager mode.
2015-05-16 16:29:50 +03:00
Serhiy Storchaka 24d3b7f9df Issue #24134: assertRaises(), assertRaisesRegex(), assertWarns() and
assertWarnsRegex() checks are not longer successful if the callable is None.

Added tests for assertRaises().
2015-05-06 19:14:47 +03:00
Serhiy Storchaka e130503c7b Issue #24134: assertRaises(), assertRaisesRegex(), assertWarns() and
assertWarnsRegex() checks are not longer successful if the callable is None.

Added tests for assertRaises().
2015-05-06 19:13:11 +03:00
Łukasz Langa a468db9b0b Issue #23310: Fix MagicMock's initializer to work with __methods__.
Behavior equivalent to m.configure_mock().  Patch by Kasia Jachim.
2015-04-13 23:12:42 -07:00
Łukasz Langa 5f6684efe0 Issue #23310: Fix MagicMock's initializer to work with __methods__.
Behavior equivalent to m.configure_mock().  Patch by Kasia Jachim.
2015-04-14 00:12:57 -07:00
Serhiy Storchaka a7d00c207f Reverted issue #24134 changes (except new tests). 2015-05-16 16:25:43 +03:00
Antoine Pitrou 8eef6a9ad0 Issue #22903: The fake test case created by unittest.loader when it fails importing a test module is now picklable. 2015-03-19 00:01:37 +01:00
Antoine Pitrou d833779cea Issue #22903: The fake test case created by unittest.loader when it fails importing a test module is now picklable. 2015-03-18 23:56:46 +01:00
Berker Peksag 7aaa85932c Issue #23568: Add rdivmod support to MagicMock() objects.
Patch by Håkan Lövdahl.
2015-03-15 01:57:38 +02:00
Berker Peksag a785dece57 Issue #23568: Add rdivmod support to MagicMock() objects.
Patch by Håkan Lövdahl.
2015-03-15 01:51:56 +02:00
Berker Peksag 9bd8af788d Issue #23581: Add matmul support to MagicMock.
Patch by Håkan Lövdahl.
2015-03-12 20:42:48 +02:00
Robert Collins f0c819acd0 Issue #22936: Allow showing local variables in unittest errors. 2015-03-06 13:46:35 +13:00
Antoine Pitrou 18f22989dd Issue #22894: TestCase.subTest() would cause the test suite to be stopped when in failfast mode, even in the absence of failures. 2014-11-23 15:55:11 +01:00
Antoine Pitrou b9079c81dd Issue #22894: TestCase.subTest() would cause the test suite to be stopped when in failfast mode, even in the absence of failures. 2014-11-23 15:56:41 +01:00
Robert Collins bf2bda3c97 Close #22457: Honour load_tests in the start_dir of discovery.
We were not honouring load_tests in a package/__init__.py when that was the
start_dir parameter, though we do when it is a child package. The fix required
a little care since it introduces the possibility of infinite recursion.
2014-11-05 03:09:01 +13:00
Robert Collins 659dd625b4 Close #7559: ImportError when loading a test now shown as ImportError.
Previously the ImportError was only shown if the top level containing
package failed to import, with other ImportErrors showing up as
AttributeError - hiding the real cause. As part of this,
`TestLoader.loadTestsFromNames` now captures errors to self.errors.
2014-10-30 08:27:27 +13:00
Robert Collins c134584020 Close #22756: Improve the test output for some assertEqual tests.
These tests were undebuggable as written, and there's no testing fallacy
involved in using the method we're testing to test the output of that method,
so switch to that.
2014-10-30 08:16:28 +13:00
Robert Collins f920c2122b Close #19746: expose unittest discovery errors on TestLoader.errors
This makes it possible to examine the errors from unittest discovery
without executing the test suite - important when the test suite may
be very large, or when enumerating the test ids from a test suite.
2014-10-20 13:24:05 +13:00
Berker Peksag 1ed2e69a4a Issue #22186: Fix typos in Lib/.
Patch by Févry Thibault.
2014-10-19 18:07:05 +03:00
Berker Peksag f23530f569 Issue #22186: Fix typos in Lib/.
Patch by Févry Thibault.
2014-10-19 18:04:38 +03:00
Benjamin Peterson e87b7eafe4 fix windows tests (#16662)
From Robert Collins.
2014-09-29 21:54:28 -04:00
Kushal Das a37b958d65 Closes #21270 : We now override tuple methods in mock.call objects. 2014-09-16 18:33:37 +05:30
Barry Warsaw bb1e3f1ebe A few tweaks for issue16662 based on feedback from Robert Collins. 2014-09-08 17:29:02 -04:00
Barry Warsaw d78742a260 - Issue #16662: load_tests() is now unconditionally run when it is present in
a package's __init__.py.  TestLoader.loadTestsFromModule() still accepts
  use_load_tests, but it is deprecated and ignored.  A new keyword-only
  attribute `pattern` is added and documented.  Patch given by Robert Collins,
  tweaked by Barry Warsaw.
2014-09-08 14:21:37 -04:00
Ezio Melotti 869778e520 #22092: merge with 3.4. 2014-08-07 03:28:26 +03:00
Ezio Melotti 1241c47aa2 #22092: use absolute imports in unittest tests. Patch by Vajrasky Kok. 2014-08-07 03:20:22 +03:00
Serhiy Storchaka 521e5860a5 Issue #22032: __qualname__ instead of __name__ is now always used to format
fully qualified class names of Python implemented classes.
2014-07-22 15:00:37 +03:00
R David Murray 130a566a13 Suppress a couple more DeprecationWarnings in the test suite. 2014-06-11 17:09:43 -04:00
Kushal Das 047f14c3c6 Closes #21256: Printout of keyword args in deterministic order in mock calls.
Printout of keyword args should be in deterministic order in
a mock function call. This will help to write better doctests.
2014-06-09 13:45:56 +05:30
Antoine Pitrou b1e58440f8 Issue #9815: assertRaises now tries to clear references to local variables in the exception's traceback. 2014-04-29 01:25:07 +02:00
Antoine Pitrou 9681022f1e Issue #9815: assertRaises now tries to clear references to local variables in the exception's traceback. 2014-04-29 01:23:50 +02:00
Ethan Furman 7b9ff0e6da Issue8297: module attribute lookup failures now include module name in error message. 2014-04-24 14:47:47 -07:00
Michael Foord ebc1a30d55 Closes issue 21239. unittest.mock.patch.stopall() did not work deterministically when the same name was patched multiple times. 2014-04-15 17:21:08 -04:00