testing-cabal / mock

The Python mock library

Home Page:https://docs.python.org/dev/library/unittest.mock.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

3.0.5: test suite fails (executed in build tree relies on already installed mock)

kloczek opened this issue · comments

+ /usr/bin/python3 setup.py test
running test
running egg_info
writing mock.egg-info/PKG-INFO
writing dependency_links to mock.egg-info/dependency_links.txt
writing requirements to mock.egg-info/requires.txt
writing top-level names to mock.egg-info/top_level.txt
reading manifest file 'mock.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'mock.egg-info/SOURCES.txt'
running build_ext
mock-3.0.5.mock.tests (unittest.loader._FailedTest) ... ERROR
test_attributes (mock.tests.testcallable.TestCallable) ... ok
test_create_autospec (mock.tests.testcallable.TestCallable) ... ok
test_create_autospec_instance (mock.tests.testcallable.TestCallable) ... ok
test_hierarchy (mock.tests.testcallable.TestCallable) ... ok
test_non_callable (mock.tests.testcallable.TestCallable) ... ok
test_patch_spec (mock.tests.testcallable.TestCallable) ... ok
test_patch_spec_callable_class (mock.tests.testcallable.TestCallable) ... ok
test_patch_spec_instance (mock.tests.testcallable.TestCallable) ... ok
test_patch_spec_set (mock.tests.testcallable.TestCallable) ... ok
test_patch_spec_set_instance (mock.tests.testcallable.TestCallable) ... ok
test_subclasses (mock.tests.testcallable.TestCallable) ... ok
test_any (mock.tests.testhelpers.AnyTest) ... ok
test_any_and_datetime (mock.tests.testhelpers.AnyTest) ... ok
test_any_mock_calls_comparison_order (mock.tests.testhelpers.AnyTest) ... ok
test_repr (mock.tests.testhelpers.AnyTest) ... ok
test_attribute_call (mock.tests.testhelpers.CallTest) ... ok
test_call (mock.tests.testhelpers.CallTest) ... ok
test_call_any (mock.tests.testhelpers.CallTest) ... ok
test_call_list (mock.tests.testhelpers.CallTest) ... ok
test_call_ne (mock.tests.testhelpers.CallTest) ... ok
test_call_non_tuples (mock.tests.testhelpers.CallTest) ... ok
test_call_with_args (mock.tests.testhelpers.CallTest) ... ok
test_call_with_args_call_empty_name (mock.tests.testhelpers.CallTest) ... ok
test_call_with_call (mock.tests.testhelpers.CallTest) ... ok
test_call_with_kwargs (mock.tests.testhelpers.CallTest) ... ok
test_call_with_name (mock.tests.testhelpers.CallTest) ... ok
test_empty__Call (mock.tests.testhelpers.CallTest) ... ok
test_extended_call (mock.tests.testhelpers.CallTest) ... ok
test_extended_not_equal (mock.tests.testhelpers.CallTest) ... ok
test_named_call_with_args (mock.tests.testhelpers.CallTest) ... ok
test_named_call_with_kwargs (mock.tests.testhelpers.CallTest) ... ok
test_named_empty_call (mock.tests.testhelpers.CallTest) ... ok
test_nested_calls_not_equal (mock.tests.testhelpers.CallTest) ... ok
test_repr (mock.tests.testhelpers.CallTest) ... ok
test_two_args_call (mock.tests.testhelpers.CallTest) ... ok
test_attributes (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_autospec_data_descriptor (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_autospec_functions_with_self_in_odd_place (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_autospec_getattr_partial_function (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_autospec_on_bound_builtin_function (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_autospec_property (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_autospec_reset_mock (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_autospec_slots (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_autospec_socket (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_basic (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_builtin_functions_types (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_builtins (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_class_with_no_init (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_create_autospec_keyword_arguments (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_create_autospec_keyword_only_arguments (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_create_autospec_none (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_create_autospec_return_value (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_descriptors (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_function (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_function_as_instance_attribute (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_inherit (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_magic_methods (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_method_calls (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_mocking_unbound_methods (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_old_style_class_with_no_init (mock.tests.testhelpers.SpecSignatureTest) ... skipped 'no old style classes in Python 3'
test_old_style_classes (mock.tests.testhelpers.SpecSignatureTest) ... skipped 'No old style classes in Python 3'
test_recursive (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_signature_callable (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_signature_class (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_signature_noncallable (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_signature_old_style_class (mock.tests.testhelpers.SpecSignatureTest) ... skipped 'no old style classes in Python 3'
test_skip_attributeerrors (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_spec_as_list (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_spec_function_assert_any_call (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_spec_function_assert_has_calls (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_spec_function_has_identifier_name (mock.tests.testhelpers.SpecSignatureTest) ... skipped 'Here to test our Py2 _isidentifier'
test_spec_function_no_name (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_spec_function_reset_mock (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_spec_has_descriptor_returning_function (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_spec_has_function_not_in_bases (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_spec_inheritance_for_classes (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_spec_inspect_signature (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_spec_set (mock.tests.testhelpers.SpecSignatureTest) ... ok
test_args_list_contains_call_list (mock.tests.testhelpers.TestCallList) ... ok
test_call_list_str (mock.tests.testhelpers.TestCallList) ... ok
test_call_list_unicode (mock.tests.testhelpers.TestCallList) ... skipped 'Unicode is properly handled with Python 3'
test_propertymock (mock.tests.testhelpers.TestCallList) ... ok
test_propertymock_returnvalue (mock.tests.testhelpers.TestCallList) ... ok
test_call_magic_method (mock.tests.testhelpers.TestCallablePredicate) ... ok
test_classmethod (mock.tests.testhelpers.TestCallablePredicate) ... ok
test_non_callable_classmethod (mock.tests.testhelpers.TestCallablePredicate) ... ok
test_non_callable_staticmethod (mock.tests.testhelpers.TestCallablePredicate) ... ok
test_staticmethod (mock.tests.testhelpers.TestCallablePredicate) ... ok
test_type (mock.tests.testhelpers.TestCallablePredicate) ... ok
test_spec_inspect_signature_annotations (mock.tests.testhelpers_py3.CallTest) ... ok
test_attributes_and_return_value (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_bound_methods (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_changing_magic_set_in_initialization (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_comparison (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_deleting_magic_methods (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_descriptor_from_class (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_dict_methods (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_dir (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_division (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_divmod_and_rdivmod (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_equality (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_hash (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_iterable_as_iter_return_value (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_len_contains_iter (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_magic_in_initialization (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_magic_method_reset_mock (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_magic_method_type (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_magic_method_wrapping (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_magic_methods_and_spec (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_magic_methods_and_spec_set (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_magic_methods_are_magic_mocks (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_magic_methods_fspath (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_magic_methods_isolated_between_mocks (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_magic_mock_equality (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_magicmock (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_magicmock_defaults (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_magicmock_del (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_matmul (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_non_default_magic_methods (mock.tests.testmagicmethods.TestMockingMagicMethods) ... skipped 'no __cmp__ in Python 3'
test_nonzero (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_numeric (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_repr (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_setting_unsupported_magic_method (mock.tests.testmagicmethods.TestMockingMagicMethods) ... /home/tkloczko/rpmbuild/BUILD/mock-3.0.5/mock/tests/testmagicmethods.py:430: DeprecationWarning: Please use assertRaisesRegex instead.
  set_setattr
ok
test_str (mock.tests.testmagicmethods.TestMockingMagicMethods) ... ok
test_unicode (mock.tests.testmagicmethods.TestMockingMagicMethods) ... skipped 'no unicode in Python 3'
test__name__ (mock.tests.testmock.MockTest) ... ok
test_adding_child_mock (mock.tests.testmock.MockTest) ... ok
test_adding_return_value_mock (mock.tests.testmock.MockTest) ... ok
test_all (mock.tests.testmock.MockTest) ... ok
test_arg_lists (mock.tests.testmock.MockTest) ... ok
test_assert_any_call (mock.tests.testmock.MockTest) ... ok
test_assert_any_call_with_function_spec (mock.tests.testmock.MockTest) ... ok
test_assert_called (mock.tests.testmock.MockTest) ... ok
test_assert_called_once (mock.tests.testmock.MockTest) ... ok
test_assert_called_once_message (mock.tests.testmock.MockTest) ... /home/tkloczko/rpmbuild/BUILD/mock-3.0.5/mock/tests/testmock.py:1571: DeprecationWarning: Please use assertRaisesRegex instead.
  m.assert_called_once)
ok
test_assert_called_once_message_not_called (mock.tests.testmock.MockTest) ... ok
test_assert_called_once_with (mock.tests.testmock.MockTest) ... ok
test_assert_called_once_with_call_list (mock.tests.testmock.MockTest) ... ok
test_assert_called_once_with_function_spec (mock.tests.testmock.MockTest) ... ok
test_assert_called_once_with_message (mock.tests.testmock.MockTest) ... ok
test_assert_called_with (mock.tests.testmock.MockTest) ... ok
test_assert_called_with_any (mock.tests.testmock.MockTest) ... ok
test_assert_called_with_failure_message (mock.tests.testmock.MockTest) ... ok
test_assert_called_with_function_spec (mock.tests.testmock.MockTest) ... ok
test_assert_called_with_message (mock.tests.testmock.MockTest) ... ok
test_assert_called_with_method_spec (mock.tests.testmock.MockTest) ... ok
test_assert_has_calls (mock.tests.testmock.MockTest) ... ok
test_assert_has_calls_any_order (mock.tests.testmock.MockTest) ... ok
test_assert_has_calls_with_function_spec (mock.tests.testmock.MockTest) ... ok
test_assert_not_called (mock.tests.testmock.MockTest) ... ok
test_assert_not_called_message (mock.tests.testmock.MockTest) ... ok
test_attach_mock (mock.tests.testmock.MockTest) ... ok
test_attach_mock_return_value (mock.tests.testmock.MockTest) ... ok
test_attribute_access_returns_mocks (mock.tests.testmock.MockTest) ... ok
test_attribute_deletion (mock.tests.testmock.MockTest) ... ok
test_attributes_have_name_and_parent_set (mock.tests.testmock.MockTest) ... ok
test_autospec_side_effect (mock.tests.testmock.MockTest) ... ok
test_autospec_side_effect_exception (mock.tests.testmock.MockTest) ... ok
test_baseexceptional_side_effect (mock.tests.testmock.MockTest) ... ok
test_call (mock.tests.testmock.MockTest) ... ok
test_call_args_comparison (mock.tests.testmock.MockTest) ... ok
test_call_args_two_tuple (mock.tests.testmock.MockTest) ... ok
test_calls_equal_with_any (mock.tests.testmock.MockTest) ... ok
test_change_return_value_via_delegate (mock.tests.testmock.MockTest) ... ok
test_change_side_effect_via_delegate (mock.tests.testmock.MockTest) ... ok
test_child_mock_call_equal (mock.tests.testmock.MockTest) ... ok
test_class_assignable (mock.tests.testmock.MockTest) ... ok
test_configure_mock (mock.tests.testmock.MockTest) ... ok
test_constructor (mock.tests.testmock.MockTest) ... ok
test_copy (mock.tests.testmock.MockTest) ... ok
test_create_autospec_classmethod_and_staticmethod (mock.tests.testmock.MockTest) ... ok
test_create_autospec_with_name (mock.tests.testmock.MockTest) ... ok
test_customize_wrapped_object_with_return_value (mock.tests.testmock.MockTest) ... ok
test_customize_wrapped_object_with_return_value_and_side_effect (mock.tests.testmock.MockTest) ... ok
test_customize_wrapped_object_with_return_value_and_side_effect2 (mock.tests.testmock.MockTest) ... ok
test_customize_wrapped_object_with_return_value_and_side_effect_default (mock.tests.testmock.MockTest) ... ok
test_customize_wrapped_object_with_side_effect_exception (mock.tests.testmock.MockTest) ... ok
test_customize_wrapped_object_with_side_effect_function (mock.tests.testmock.MockTest) ... ok
test_customize_wrapped_object_with_side_effect_iterable (mock.tests.testmock.MockTest) ... ok
test_customize_wrapped_object_with_side_effect_iterable_with_default (mock.tests.testmock.MockTest) ... ok
test_dir (mock.tests.testmock.MockTest) ... ok
test_dir_does_not_include_deleted_attributes (mock.tests.testmock.MockTest) ... ok
test_dir_from_spec (mock.tests.testmock.MockTest) ... ok
test_exceptional_side_effect (mock.tests.testmock.MockTest) ... ok
test_filter_dir (mock.tests.testmock.MockTest) ... ok
test_from_spec (mock.tests.testmock.MockTest) ... ok
test_isinstance_under_settrace (mock.tests.testmock.MockTest) ... ok
test_magic_methods_mock_calls (mock.tests.testmock.MockTest) ... ok
test_manager_mock (mock.tests.testmock.MockTest) ... ok
test_method_calls_compare_easily (mock.tests.testmock.MockTest) ... ok
test_method_calls_recorded (mock.tests.testmock.MockTest) ... ok
test_mock_add_spec (mock.tests.testmock.MockTest) ... ok
test_mock_add_spec_magic_methods (mock.tests.testmock.MockTest) ... ok
test_mock_call_not_equal_leaf (mock.tests.testmock.MockTest) ... ok
test_mock_call_not_equal_non_leaf (mock.tests.testmock.MockTest) ... ok
test_mock_call_not_equal_non_leaf_attr (mock.tests.testmock.MockTest) ... ok
test_mock_call_not_equal_non_leaf_call_versus_attr (mock.tests.testmock.MockTest) ... ok
test_mock_call_not_equal_non_leaf_params_different (mock.tests.testmock.MockTest) ... ok
test_mock_call_repr (mock.tests.testmock.MockTest) ... ok
test_mock_call_repr_loop (mock.tests.testmock.MockTest) ... /home/tkloczko/rpmbuild/BUILD/mock-3.0.5/mock/tests/testmock.py:1183: DeprecationWarning: Please use assertRegex instead.
  self.assertRegexpMatches(repr(m.foo()), r"<Mock name='mock\(\)' id='\d+'>")
ok
test_mock_calls (mock.tests.testmock.MockTest) ... ok
test_mock_calls_contains (mock.tests.testmock.MockTest) ... ok
test_mock_calls_create_autospec (mock.tests.testmock.MockTest) ... ok
test_mock_does_not_raise_on_repeated_attribute_deletion (mock.tests.testmock.MockTest) ... ok
test_mock_open_after_eof (mock.tests.testmock.MockTest) ... ok
test_mock_open_alter_readline (mock.tests.testmock.MockTest) ... ok
test_mock_open_dunder_iter_issue (mock.tests.testmock.MockTest) ... ok
test_mock_open_reuse_issue_21750 (mock.tests.testmock.MockTest) ... ok
test_mock_open_write (mock.tests.testmock.MockTest) ... ok
test_mock_parents (mock.tests.testmock.MockTest) ... ok
test_mock_raises_when_deleting_nonexistent_attribute (mock.tests.testmock.MockTest) ... ok
test_mock_unsafe (mock.tests.testmock.MockTest) ... ok
test_name_attribute_of_call (mock.tests.testmock.MockTest) ... ok
test_only_allowed_methods_exist (mock.tests.testmock.MockTest) ... ok
test_override_tuple_methods (mock.tests.testmock.MockTest) ... ok
test_parent_attribute_of_call (mock.tests.testmock.MockTest) ... ok
test_parent_propagation_with_create_autospec (mock.tests.testmock.MockTest) ... ok
test_repr (mock.tests.testmock.MockTest) ... ok
test_repr_with_spec (mock.tests.testmock.MockTest) ... ok
test_reset_mock (mock.tests.testmock.MockTest) ... ok
test_reset_mock_does_not_raise_on_attr_deletion (mock.tests.testmock.MockTest) ... ok
test_reset_mock_on_mock_open_issue_18622 (mock.tests.testmock.MockTest) ... ok
test_reset_mock_recursion (mock.tests.testmock.MockTest) ... ok
test_reset_return (mock.tests.testmock.MockTest) ... ok
test_reset_return_sideeffect (mock.tests.testmock.MockTest) ... ok
test_reset_sideeffect (mock.tests.testmock.MockTest) ... ok
test_return_value_in_constructor (mock.tests.testmock.MockTest) ... ok
test_setting_attribute_with_spec_set (mock.tests.testmock.MockTest) ... ok
test_setting_call (mock.tests.testmock.MockTest) ... ok
test_side_effect (mock.tests.testmock.MockTest) ... ok
test_side_effect_iterator (mock.tests.testmock.MockTest) ... ok
test_side_effect_iterator_default (mock.tests.testmock.MockTest) ... ok
test_side_effect_iterator_exceptions (mock.tests.testmock.MockTest) ... ok
test_side_effect_setting_iterator (mock.tests.testmock.MockTest) ... ok
test_sorted_call_signature (mock.tests.testmock.MockTest) ... ok
test_spec_class (mock.tests.testmock.MockTest) ... ok
test_spec_class_no_object_base (mock.tests.testmock.MockTest) ... ok
test_spec_list_subclass (mock.tests.testmock.MockTest) ... ok
test_spec_old_style_classes (mock.tests.testmock.MockTest) ... skipped 'no old style classes in Python 3'
test_spec_set_old_style_classes (mock.tests.testmock.MockTest) ... skipped 'no old style classes in Python 3'
test_subclass_with_properties (mock.tests.testmock.MockTest) ... ok
test_subclassing (mock.tests.testmock.MockTest) ... ok
test_wraps_attributes (mock.tests.testmock.MockTest) ... ok
test_wraps_call_with_nondefault_return_value (mock.tests.testmock.MockTest) ... ok
test_wraps_calls (mock.tests.testmock.MockTest) ... ok
test_wraps_prevents_automatic_creation_of_mocks (mock.tests.testmock.MockTest) ... ok
test_autospec (mock.tests.testpatch.PatchTest) ... ok
test_autospec_classmethod (mock.tests.testpatch.PatchTest) ... ok
test_autospec_function (mock.tests.testpatch.PatchTest) ... ok
test_autospec_inherits (mock.tests.testpatch.PatchTest) ... ok
test_autospec_keywords (mock.tests.testpatch.PatchTest) ... ok
test_autospec_name (mock.tests.testpatch.PatchTest) ... ok
test_autospec_staticmethod (mock.tests.testpatch.PatchTest) ... ok
test_autospec_with_new (mock.tests.testpatch.PatchTest) ... ok
test_autospec_with_object (mock.tests.testpatch.PatchTest) ... ok
test_callable_spec_as_list (mock.tests.testpatch.PatchTest) ... ok
test_cant_set_kwargs_when_passing_a_mock (mock.tests.testpatch.PatchTest) ... ok
test_create_and_specs (mock.tests.testpatch.PatchTest) ... ok
test_dotted_but_module_not_loaded (mock.tests.testpatch.PatchTest) ... ok
test_falsey_spec (mock.tests.testpatch.PatchTest) ... ok
test_get_only_proxy (mock.tests.testpatch.PatchTest) ... ok
test_get_set_delete_proxy (mock.tests.testpatch.PatchTest) ... ok
test_invalid_target (mock.tests.testpatch.PatchTest) ... ok
test_mock_calls_with_patch (mock.tests.testpatch.PatchTest) ... ok
test_multiple_patchobject (mock.tests.testpatch.PatchTest) ... ok
test_multiple_specs (mock.tests.testpatch.PatchTest) ... ok
test_name_preserved (mock.tests.testpatch.PatchTest) ... ok
test_nested_patch_failure (mock.tests.testpatch.PatchTest) ... ok
test_nested_patch_with_spec_as_list (mock.tests.testpatch.PatchTest) ... ok
test_new_callable_class_decorating (mock.tests.testpatch.PatchTest) ... ok
test_new_callable_create (mock.tests.testpatch.PatchTest) ... ok
test_new_callable_failure (mock.tests.testpatch.PatchTest) ... ok
test_new_callable_incompatible_with_autospec (mock.tests.testpatch.PatchTest) ... ok
test_new_callable_incompatible_with_new (mock.tests.testpatch.PatchTest) ... ok
test_new_callable_inherit_for_mocks (mock.tests.testpatch.PatchTest) ... ok
test_new_callable_inherit_non_mock (mock.tests.testpatch.PatchTest) ... ok
test_new_callable_keyword_arguments (mock.tests.testpatch.PatchTest) ... ok
test_new_callable_patch (mock.tests.testpatch.PatchTest) ... ok
test_new_callable_patch_object (mock.tests.testpatch.PatchTest) ... ok
test_new_callable_spec (mock.tests.testpatch.PatchTest) ... ok
test_not_callable_spec_as_list (mock.tests.testpatch.PatchTest) ... ok
test_object_lookup_is_quite_lazy (mock.tests.testpatch.PatchTest) ... ok
test_patch (mock.tests.testpatch.PatchTest) ... ok
test_patch_builtins_without_create (mock.tests.testpatch.PatchTest) ... ok
test_patch_class_acts_with_spec_is_inherited (mock.tests.testpatch.PatchTest) ... ok
test_patch_class_attribute (mock.tests.testpatch.PatchTest) ... ok
test_patch_class_decorator (mock.tests.testpatch.PatchTest) ... ok
test_patch_dict (mock.tests.testpatch.PatchTest) ... ok
test_patch_dict_class_decorator (mock.tests.testpatch.PatchTest) ... ok
test_patch_dict_decorator_resolution (mock.tests.testpatch.PatchTest) ... ok
test_patch_dict_keyword_args (mock.tests.testpatch.PatchTest) ... ok
test_patch_dict_start_stop (mock.tests.testpatch.PatchTest) ... ok
test_patch_dict_test_prefix (mock.tests.testpatch.PatchTest) ... ok
test_patch_dict_with_clear (mock.tests.testpatch.PatchTest) ... ok
test_patch_dict_with_container_object (mock.tests.testpatch.PatchTest) ... ok
test_patch_dict_with_container_object_and_clear (mock.tests.testpatch.PatchTest) ... ok
test_patch_dict_with_string (mock.tests.testpatch.PatchTest) ... ok
test_patch_dict_with_unicode (mock.tests.testpatch.PatchTest) ... ok
test_patch_imports_lazily (mock.tests.testpatch.PatchTest) ... ok
test_patch_keyword_args (mock.tests.testpatch.PatchTest) ... ok
test_patch_local (mock.tests.testpatch.PatchTest) ... ok
test_patch_multiple (mock.tests.testpatch.PatchTest) ... ok
test_patch_multiple_create (mock.tests.testpatch.PatchTest) ... ok
test_patch_multiple_create_mocks (mock.tests.testpatch.PatchTest) ... ok
test_patch_multiple_create_mocks_different_order (mock.tests.testpatch.PatchTest) ... ok
test_patch_multiple_create_mocks_patcher (mock.tests.testpatch.PatchTest) ... ok
test_patch_multiple_decorating_class (mock.tests.testpatch.PatchTest) ... ok
test_patch_multiple_failure (mock.tests.testpatch.PatchTest) ... ok
test_patch_multiple_new_callable (mock.tests.testpatch.PatchTest) ... ok
test_patch_multiple_new_callable_failure (mock.tests.testpatch.PatchTest) ... ok
test_patch_multiple_no_kwargs (mock.tests.testpatch.PatchTest) ... ok
test_patch_multiple_spec_set (mock.tests.testpatch.PatchTest) ... ok
test_patch_multiple_stacked_decorators (mock.tests.testpatch.PatchTest) ... ok
test_patch_multiple_string_subclasses (mock.tests.testpatch.PatchTest) ... ok
test_patch_nested_autospec_repr (mock.tests.testpatch.PatchTest) ... ok
test_patch_object_keyword_args (mock.tests.testpatch.PatchTest) ... ok
test_patch_object_with_spec_as_boolean (mock.tests.testpatch.PatchTest) ... ok
test_patch_propogrates_exc_on_exit (mock.tests.testpatch.PatchTest) ... ok
test_patch_slots (mock.tests.testpatch.PatchTest) ... ok
test_patch_spec_set (mock.tests.testpatch.PatchTest) ... ok
test_patch_start_stop (mock.tests.testpatch.PatchTest) ... ok
test_patch_stopall (mock.tests.testpatch.PatchTest) ... ok
test_patch_test_prefix (mock.tests.testpatch.PatchTest) ... ok
test_patch_with_create_mocks_non_existent_attributes (mock.tests.testpatch.PatchTest) ... ok
test_patch_with_exception (mock.tests.testpatch.PatchTest) ... ok
test_patch_with_spec (mock.tests.testpatch.PatchTest) ... ok
test_patch_with_spec_as_boolean (mock.tests.testpatch.PatchTest) ... ok
test_patch_with_spec_as_list (mock.tests.testpatch.PatchTest) ... ok
test_patch_with_spec_mock_repr (mock.tests.testpatch.PatchTest) ... ok
test_patch_with_static_methods (mock.tests.testpatch.PatchTest) ... ok
test_patch_wont_create_by_default (mock.tests.testpatch.PatchTest) ... ok
test_patchobject_class_decorator (mock.tests.testpatch.PatchTest) ... ok
test_patchobject_start_stop (mock.tests.testpatch.PatchTest) ... ok
test_patchobject_twice (mock.tests.testpatch.PatchTest) ... ok
test_patchobject_with_create_mocks_non_existent_attributes (mock.tests.testpatch.PatchTest) ... ok
test_patchobject_with_default_mock (mock.tests.testpatch.PatchTest) ... ok
test_patchobject_with_none (mock.tests.testpatch.PatchTest) ... ok
test_patchobject_with_spec (mock.tests.testpatch.PatchTest) ... ok
test_patchobject_with_spec_as_list (mock.tests.testpatch.PatchTest) ... ok
test_patchobject_wont_create_by_default (mock.tests.testpatch.PatchTest) ... ok
test_single_patchobject (mock.tests.testpatch.PatchTest) ... ok
test_spec_set_inherit (mock.tests.testpatch.PatchTest) ... ok
test_spec_set_true (mock.tests.testpatch.PatchTest) ... ok
test_special_attrs (mock.tests.testpatch.PatchTest) ... ok
test_specs_false_instead_of_none (mock.tests.testpatch.PatchTest) ... ok
test_stop_idempotent (mock.tests.testpatch.PatchTest) ... ok
test_stop_without_start (mock.tests.testpatch.PatchTest) ... ok
test_stopall_lifo (mock.tests.testpatch.PatchTest) ... ok
test_tracebacks (mock.tests.testpatch.PatchTest) ... ok
test_wrapped_patch (mock.tests.testpatch.PatchTest) ... ok
test_wrapped_patch_dict (mock.tests.testpatch.PatchTest) ... ok
test_wrapped_patch_multiple (mock.tests.testpatch.PatchTest) ... ok
test_wrapped_patch_object (mock.tests.testpatch.PatchTest) ... ok
test_wrapped_several_times_patch (mock.tests.testpatch.PatchTest) ... ok
test_attribute_chain_is_maintained (mock.tests.testsealable.TestSealable) ... ok
test_attributes_return_more_mocks_by_default (mock.tests.testsealable.TestSealable) ... ok
test_call_chain_is_maintained (mock.tests.testsealable.TestSealable) ... ok
test_call_on_defined_sealed_mock_succeeds (mock.tests.testsealable.TestSealable) ... ok
test_call_on_sealed_mock_fails (mock.tests.testsealable.TestSealable) ... ok
test_existing_attributes_allowed_after_seal (mock.tests.testsealable.TestSealable) ... ok
test_existing_attributes_can_be_set_on_seal (mock.tests.testsealable.TestSealable) ... ok
test_initialized_attributes_allowed_after_seal (mock.tests.testsealable.TestSealable) ... ok
test_integration_with_spec_att_definition (mock.tests.testsealable.TestSealable)
You are not restricted when using mock with spec ... ok
test_integration_with_spec_method_definition (mock.tests.testsealable.TestSealable)
You need to defin the methods, even if they are in the spec ... ok
test_integration_with_spec_method_definition_respects_spec (mock.tests.testsealable.TestSealable)
You cannot define methods out of the spec ... ok
test_new_attributes_cannot_be_accessed_on_seal (mock.tests.testsealable.TestSealable) ... ok
test_new_attributes_cannot_be_set_on_child_of_seal (mock.tests.testsealable.TestSealable) ... ok
test_new_attributes_cannot_be_set_on_seal (mock.tests.testsealable.TestSealable) ... ok
test_sealed_exception_has_attribute_name (mock.tests.testsealable.TestSealable) ... ok
test_seals_dont_recurse_on_manual_attributes (mock.tests.testsealable.TestSealable) ... ok
test_seals_recurse_on_added_attributes (mock.tests.testsealable.TestSealable) ... ok
test_seals_recurse_on_magic_methods (mock.tests.testsealable.TestSealable) ... ok
testBases (mock.tests.testsentinel.SentinelTest) ... ok
testCopy (mock.tests.testsentinel.SentinelTest) ... ok
testDEFAULT (mock.tests.testsentinel.SentinelTest) ... ok
testPickle (mock.tests.testsentinel.SentinelTest) ... ok
testSentinelName (mock.tests.testsentinel.SentinelTest) ... ok
testSentinels (mock.tests.testsentinel.SentinelTest) ... ok
test_cant_uncache_sys (mock.tests.testsupport.TestUncache) ... ok
test_uncache_non_existent (mock.tests.testsupport.TestUncache) ... ok
test_dunder_iter_data (mock.tests.testwith.TestMockOpen) ... ok
test_explicit_mock (mock.tests.testwith.TestMockOpen) ... ok
test_interleaved_reads (mock.tests.testwith.TestMockOpen) ... ok
test_mock_open (mock.tests.testwith.TestMockOpen) ... ok
test_mock_open_context_manager (mock.tests.testwith.TestMockOpen) ... ok
test_mock_open_context_manager_multiple_times (mock.tests.testwith.TestMockOpen) ... ok
test_mock_open_read_with_argument (mock.tests.testwith.TestMockOpen) ... ok
test_overriding_return_values (mock.tests.testwith.TestMockOpen) ... ok
test_read_bytes (mock.tests.testwith.TestMockOpen) ... ok
test_read_data (mock.tests.testwith.TestMockOpen) ... ok
test_readline_bytes (mock.tests.testwith.TestMockOpen) ... ok
test_readline_data (mock.tests.testwith.TestMockOpen) ... ok
test_readlines_bytes (mock.tests.testwith.TestMockOpen) ... ok
test_readlines_data (mock.tests.testwith.TestMockOpen) ... ok
testContextManagerMocking (mock.tests.testwith.WithTest) ... ok
test_context_manager_with_magic_mock (mock.tests.testwith.WithTest) ... ok
test_dict_context_manager (mock.tests.testwith.WithTest) ... ok
test_double_patch_instance_method (mock.tests.testwith.WithTest) ... ok
test_patch_object_with_statement (mock.tests.testwith.WithTest) ... ok
test_with_statement (mock.tests.testwith.WithTest) ... ok
test_with_statement_as (mock.tests.testwith.WithTest) ... ok
test_with_statement_exception (mock.tests.testwith.WithTest) ... ok
test_with_statement_imbricated (mock.tests.testwith.WithTest) ... ok
test_with_statement_nested (mock.tests.testwith.WithTest) ... ok
test_with_statement_same_attribute (mock.tests.testwith.WithTest) ... ok
test_with_statement_specified (mock.tests.testwith.WithTest) ... ok
mock-3.0.5.mock.tests (unittest.loader._FailedTest) ... ERROR

======================================================================
ERROR: mock-3.0.5.mock.tests (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: mock-3.0.5.mock.tests
Traceback (most recent call last):
  File "/usr/lib64/python3.7/unittest/loader.py", line 470, in _find_test_path
    package = self._get_module_from_name(name)
  File "/usr/lib64/python3.7/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
ModuleNotFoundError: No module named 'mock-3'


======================================================================
ERROR: mock-3.0.5.mock.tests (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: mock-3.0.5.mock.tests
Traceback (most recent call last):
  File "/usr/lib64/python3.7/unittest/loader.py", line 470, in _find_test_path
    package = self._get_module_from_name(name)
  File "/usr/lib64/python3.7/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
ModuleNotFoundError: No module named 'mock-3'


----------------------------------------------------------------------
Ran 408 tests in 0.557s

FAILED (errors=2, skipped=9)
Test failed: <unittest.runner.TextTestResult run=408 errors=2 failures=0>
error: Test failed: <unittest.runner.TextTestResult run=408 errors=2 failures=0>
error: Bad exit status from /var/tmp/rpm-tmp.nWjdAW (%check)

What lead you to believe that setup.py test would work?
What are you looking to achieve?

This is not matter of believing in anything.
If source code tree provides test suite I'm trying to use it on packaging stage.
It fails and I'm reporting this.
Only this and nothing more.

Okay, but setup.py test isn't documented for this project that I can find. If it is, please let me know where so I can correct it.

For this project, the correct way to run the tests is to use the same methodology the CI does:

pip install -e .[dev]
pytest

You haven't provided any context about why you're running the tests, so I can't help you more.

@kloczek, FTR, I've been able to run the tests without this absurd voodoo by using plain unittest, i.e.:

PYTHONPATH=. python -m unittest discover

Note that this doesn't handle pytest-specific conftest.py, so you have to deal with removing *py3* for Python 2 testing yourself.

@mgorny - I find the tone of your comment unpleasant, please consider how terms like "absurd voodoo" might be perceived by others.

You appear to want to go out of your way to not run the tests in the way prescribed by the project. That is confusing and likely to lead you into problems.

As I said above, the correct way to run the test suite for this project is:

pip install -e .[dev]
pytest

What is preventing you from doing that?

For a start, we want to check whether the package works before it's installed into user's system. And we want to have it installed and tracked via the system package manager, not pip.

Who is "we" here?

If you want a system package, you should build a system package, and the test that in isolation before making in generally available. You will have to deal with testing-only dependencies (pytest in this case), which I guess you could model using build-time deps.

You still need to use the testing methodology the package has, rather than ignoring the package's requirements, trying to do your own (incorrect) thing and then complaining when it doesn't work.

We is Gentoo. But the problem applies to all source distributions where things are built on user systems. I would be happy to use package's 'testing methodology' if it worked. But it doesn't, and I don't have all the time in the world to figure out how to make it work without having to break user systems in the process.

I'm sorry, but the nightly running CI doesn't agree with your assessment: https://circleci.com/gh/testing-cabal/mock/tree/master

'It works in our pristine environment, so we're going to ignore that it fails for everybody else' is not a very helpful attitude.

It looks like you're not going to be happy with any reasonable answer, so I think this conversation is done.