Giter Site home page Giter Site logo

chai's People

Contributors

awestendorf avatar czarneckid avatar graylinkim avatar jasonbaker avatar pypingou avatar vbabiy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chai's Issues

Support stubbing constants

Extend the stub() functions so that non-callables can be stubbed. This is helpful for changing constants during a test.

Unmet expectations are ignored

This appears to be a regression introduced in 0.4.6.

Consider this code:

import chai

class Foo(object):
    def foo(self):
        pass

class MyTest(chai.Chai):
    def testFoo(self):
        obj = Foo()
        self.expect(obj.foo).times(1)

As you can see, we never invoke obj.foo, so this test should fail. Yet, in Chai 0.4.6 it succeeds.

The culprit is the change in 0.4.6 to tear down stubs immediately after the test. Doing so clears stub._expectations โ€“ yet this also has the undesirable effect of clearing stub.unmet_expectations().

Support for streamlined race condition testing

Spies and side-effects are useful for testing race conditions. The pattern is something like:

def _side_effect(state):
  if state['called']:
    return
  state['called'] = True
  response = race_condition_maker()

self.spy(race_condition_entry_point).side_effect(_side_effect, {'called':False})
race_condition_maker()

This is very useful, but the tracking of called feels like a hack. Try to find a means to streamline the process, perhaps as self.spy(...).race_condition(race_condition_maker, *args, **kwargs).

Support fuzzy argument match

Sometimes it's not necessary to test for all kwargs, just a few specific ones. This can be done now with expect(..).args(.., x=ignore()), but you need to do that for each named parameter. One of the following APIs might be better:

expect(..).args(.., **ignore())

or

expect(..).like(..)

Wouldn't have to re-use ignore in the first case, a new comparator could be introduced. If **ignore() is supported, *ignore() should be as well. That could all be very crazy, but not out of the question.

The second case is something I've thought about for awhile, where it would be a fuzzy match on *a, **k, such that only the first N values in the test case would be compared against *a, and only the named parameters of the test case would be compared against **k.

Unstubbing constructors in Python3 breaks class

The constructor stubbing implementation works by hotswapping the __new__ magic function. Dynamically assigning __new__ is broken as of Python3.5 Issue 25731.

I have been able to work around this by providing my own __new__ implementation instead of falling back to object.__new__.

Python2 traceback handling issue?

It seems to me that the following code is the inverse of what should be there (in chai.py, around line 56):

  try:
    func(self, *args, **kwargs)
  except UnexpectedCall as e:
    # if this is not python3, use python2 syntax
    if not hasattr(e, '__traceback__'):
      import python2
      python2.reraise(e, '\n\n'+str(e), sys.exc_info()[-1])
    exc = AssertionError('\n\n'+str(e))
    setattr(exc, '__traceback__', sys.exc_info()[-1])
    raise exc

Using this with python 2.7.4 gives me an import error for python 2. I thing __traceback__ was introduced for python 3, and as such the code should be (removed the not and moved the comment below):

  try:
    func(self, *args, **kwargs)
  except UnexpectedCall as e:
    if hasattr(e, '__traceback__'):
      import python2
      python2.reraise(e, '\n\n'+str(e), sys.exc_info()[-1])
    # if this is not python3, use python2 syntax
    exc = AssertionError('\n\n'+str(e))
    setattr(exc, '__traceback__', sys.exc_info()[-1])
    raise exc

Add assert_not_called

This would be a wrapper around stub(). Perhaps uses a subclass so that it can enforce that no expectations are added?

Tests fail on Fedora python 3.3

$ nosetests-3.3   
............................................F.....................................................
............S..................S.....................................................SSSSSS
======================================================================
FAIL: test_is_a_unicode_test (tests.comparator_test_py2.ComparatorsPy2Test)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/pingou/repos/gitrepo/chai/tests/comparator_test_py2.py", line 12, in test_is_a_unicode_test
    self.assertFalse( comp.test(u'foo') )
AssertionError: True is not false

----------------------------------------------------------------------
Ran 189 tests in 0.159s

FAILED (SKIP=8, failures=1)

Add "modify()" modifier to spies

This would allow spying, and then the user could modify the returned value. This would be very useful where the spied method performs a complicated task (e.g. fetch auth token) and the return data only needs slight modification for the test (e.g. change TTL).

It would look something like this:

spy( method ).modify( lambda method_return: ... )

1.1.2: pytest warnings

+ /usr/bin/python3 -Bm pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.9, pytest-6.2.3, py-1.10.0, pluggy-0.13.1
rootdir: /home/tkloczko/rpmbuild/BUILD/chai-1.1.2
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, cov-2.11.1, httpbin-1.0.0, xdist-2.2.1, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, pyfakefs-4.4.0, freezegun-0.4.2, cases-3.4.6, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, flaky-3.7.0, mock-3.6.0, hypothesis-6.12.0, asyncio-0.15.1
collected 197 items

tests/chai_test.py ...........                                                                                                                                       [  5%]
tests/comparator_test.py ..................................                                                                                                          [ 22%]
tests/expectation_test.py ...................................                                                                                                        [ 40%]
tests/functional_test.py ....                                                                                                                                        [ 42%]
tests/mock_test.py ................                                                                                                                                  [ 50%]
tests/sample_test.py ......................................                                                                                                          [ 70%]
tests/stub_test.py ..................s.......................s.sss............                                                                                       [100%]

============================================================================= warnings summary =============================================================================
tests/chai_test.py::ChaiTest::test_expect
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/chai_test.py:106: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( deque(), case._stubs )

tests/chai_test.py::ChaiTest::test_expect
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/chai_test.py:108: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( deque([milk.pour]), case._stubs )

tests/chai_test.py::ChaiTest::test_expect
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/chai_test.py:112: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( deque([milk.pour]), case._stubs )

tests/chai_test.py::ChaiTest::test_expect
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/chai_test.py:114: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( 2, len(milk.pour._expectations) )

tests/chai_test.py::ChaiTest::test_mock_no_binding
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/chai_test.py:120: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( deque(), case._mocks )

tests/chai_test.py::ChaiTest::test_mock_no_binding
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/chai_test.py:123: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( deque(), case._mocks )

tests/chai_test.py::ChaiTest::test_mock_no_binding
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/chai_test.py:126: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( deque(), case._mocks )

tests/chai_test.py::ChaiTest::test_mock_with_attr_binding
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/chai_test.py:139: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( deque(), case._mocks )

tests/chai_test.py::ChaiTest::test_mock_with_attr_binding
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/chai_test.py:142: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( deque([(milk,'pour',orig_pour)]), case._mocks )

tests/chai_test.py::ChaiTest::test_mock_with_attr_binding
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/chai_test.py:145: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( deque([(milk,'pour',orig_pour),(milk,'pour',mock1)]), case._mocks )

tests/chai_test.py::ChaiTest::test_mock_with_attr_binding
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/chai_test.py:150: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( deque([(milk,'pour',orig_pour),(milk,'pour',mock1),(milk,'foo')]), case._mocks )

tests/chai_test.py::ChaiTest::test_runs_unmet_expectations
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/chai_test.py:172: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(1, stub.unmet_calls)

tests/chai_test.py::ChaiTest::test_runs_unmet_expectations
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/chai_test.py:173: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(1, stub.teardown_calls)

tests/chai_test.py::ChaiTest::test_setup
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/chai_test.py:62: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( deque(), case._stubs )

tests/chai_test.py::ChaiTest::test_setup
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/chai_test.py:63: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( deque(), case._mocks )

tests/chai_test.py::ChaiTest::test_stub
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/chai_test.py:90: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( deque(), case._stubs )

tests/chai_test.py::ChaiTest::test_stub
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/chai_test.py:93: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( deque([milk.pour]), case._stubs )

tests/chai_test.py::ChaiTest::test_stub
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/chai_test.py:97: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( deque([milk.pour]), case._stubs )

tests/chai_test.py::ChaiTest::test_teardown_closes_out_stubs_and_mocks
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/chai_test.py:79: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( 1, stub.calls )

tests/chai_test.py::ChaiTest::test_teardown_closes_out_stubs_and_mocks
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/chai_test.py:80: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( 'fee', obj.mock1 )

tests/comparator_test.py::ComparatorsTest::test_all
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/comparator_test.py:152: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( 'foo'.encode('ascii'), bytearray('foo'.encode('ascii')) )

tests/comparator_test.py::ComparatorsTest::test_almost_equal_repr
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/comparator_test.py:102: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(repr(comp), "AlmostEqual(value: 3.14159265, places: 3)")

tests/comparator_test.py::ComparatorsTest::test_any_repr
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/comparator_test.py:125: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(repr(comp), "Any([1, 2, 3, Any([IsA(str), Is(<class 'str'>)])])")

tests/comparator_test.py::ComparatorsTest::test_eq
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/comparator_test.py:50: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( comp, 3 )

tests/comparator_test.py::ComparatorsTest::test_equals_repr
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/comparator_test.py:46: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(str(comp), "3")

tests/comparator_test.py::ComparatorsTest::test_is
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/comparator_test.py:82: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( obj1, obj2 )

tests/comparator_test.py::ComparatorsTest::test_is_a_format_name
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/comparator_test.py:71: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(comp._format_name(), "str")

tests/comparator_test.py::ComparatorsTest::test_is_a_format_name
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/comparator_test.py:73: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(comp._format_name(), "['str', 'list']")

tests/comparator_test.py::ComparatorsTest::test_is_a_repr
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/comparator_test.py:67: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(repr(comp), "IsA(str)")

tests/comparator_test.py::ComparatorsTest::test_is_repr
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/comparator_test.py:93: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(repr(Is(obj)), "Is(An Object)" )

tests/comparator_test.py::ComparatorsTest::test_like_init
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/comparator_test.py:217: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( {'foo':'bar'}, c._src )

tests/comparator_test.py::ComparatorsTest::test_like_init
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/comparator_test.py:220: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( ['foo','bar'], c._src )

tests/comparator_test.py::ComparatorsTest::test_like_repr
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/comparator_test.py:235: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( repr(c), "Like({'foo': 'bar'})" )

tests/comparator_test.py::ComparatorsTest::test_regex_repr
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/comparator_test.py:112: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(repr(comp), "Regex(pattern: [wf][io]{2}, flags: 0)")

tests/comparator_test.py::ComparatorsTest::test_variable
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/comparator_test.py:189: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( 0, len(Variable._cache) )

tests/comparator_test.py::ComparatorsTest::test_variable
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/comparator_test.py:191: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( 1, len(Variable._cache) )

tests/comparator_test.py::ComparatorsTest::test_variable
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/comparator_test.py:197: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( 1, len(Variable._cache) )

tests/comparator_test.py::ComparatorsTest::test_variable
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/comparator_test.py:199: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( 'bar', comp.value )

tests/comparator_test.py::ComparatorsTest::test_variable
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/comparator_test.py:200: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( 'bar', Variable('foo').value )

tests/comparator_test.py::ComparatorsTest::test_variable
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/comparator_test.py:203: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( 1, len(Variable._cache) )

tests/comparator_test.py::ComparatorsTest::test_variable
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/comparator_test.py:205: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( 'dog', v.value )

tests/comparator_test.py::ComparatorsTest::test_variable
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/comparator_test.py:206: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( 2, len(Variable._cache) )

tests/comparator_test.py::ComparatorsTest::test_variable
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/comparator_test.py:209: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( 0, len(Variable._cache) )

tests/comparator_test.py::ComparatorsTest::test_variable_repr
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/comparator_test.py:213: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( repr(v), "Variable('foo')" )

tests/expectation_test.py::ExpectationRule::test_any_order
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/expectation_test.py:128: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( exp, exp.any_order().times(1) )

tests/expectation_test.py::ExpectationRule::test_any_order_with_no_max
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/expectation_test.py:139: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( exp, exp.any_order().at_least_once() )

tests/expectation_test.py::ExpectationRule::test_at_least
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/expectation_test.py:102: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( exp, exp.at_least(10) )

tests/expectation_test.py::ExpectationRule::test_at_least_once
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/expectation_test.py:96: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( exp, exp.at_least_once() )

tests/expectation_test.py::ExpectationRule::test_at_most
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/expectation_test.py:115: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( exp, exp.args(1).at_most(10) )

tests/expectation_test.py::ExpectationRule::test_at_most_once
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/expectation_test.py:109: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( exp, exp.args(1).at_most_once() )

tests/expectation_test.py::ExpectationRule::test_once
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/expectation_test.py:122: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( exp, exp.args(1).once() )

tests/expectation_test.py::ExpectationRule::test_return_value_with_exception_class
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/expectation_test.py:264: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( exp, exp.raises(CustomException) )

tests/expectation_test.py::ExpectationRule::test_return_value_with_exception_instance
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/expectation_test.py:272: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( exp, exp.raises(CustomException()) )

tests/expectation_test.py::ExpectationRule::test_return_value_with_value
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/expectation_test.py:226: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(exp.test(), 123)

tests/expectation_test.py::ExpectationRule::test_return_value_with_variable
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/expectation_test.py:234: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(exp.test(), 123)

tests/expectation_test.py::ExpectationRule::test_return_value_with_variable_in_tuple
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/expectation_test.py:243: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(exp.test(), (123,'foo'))

tests/expectation_test.py::ExpectationRule::test_side_effect
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/expectation_test.py:154: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( exp, exp.side_effect(effect) )

tests/expectation_test.py::ExpectationRule::test_side_effect
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/expectation_test.py:156: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( ['foo'], called )

tests/expectation_test.py::ExpectationRule::test_side_effect_with_an_exception
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/expectation_test.py:188: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( exp, exp.side_effect(effect).raises(Zono) )

tests/expectation_test.py::ExpectationRule::test_side_effect_with_an_exception
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/expectation_test.py:190: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( ['foo'], called )

tests/expectation_test.py::ExpectationRule::test_side_effect_with_args
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/expectation_test.py:165: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( exp, exp.side_effect(effect, 'a', b='c') )

tests/expectation_test.py::ExpectationRule::test_side_effect_with_args
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/expectation_test.py:167: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( ['foo'], called )

tests/expectation_test.py::ExpectationRule::test_side_effect_with_passed_args
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/expectation_test.py:177: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( exp, exp.side_effect(effect) )

tests/expectation_test.py::ExpectationRule::test_side_effect_with_passed_args
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/expectation_test.py:179: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( ['foo'], called )

tests/expectation_test.py::ExpectationRule::test_teardown
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/expectation_test.py:202: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( ['foo'], called )

tests/expectation_test.py::ExpectationRule::test_times
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/expectation_test.py:90: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( exp, exp.times(3) )

tests/expectation_test.py::ExpectationRule::test_times
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/expectation_test.py:91: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( 3, exp._min_count )

tests/expectation_test.py::ExpectationRule::test_times
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/expectation_test.py:92: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( 3, exp._max_count )

tests/expectation_test.py::ExpectationRule::test_with_returns_return_value
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/expectation_test.py:249: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(num, 123)

tests/functional_test.py::FunctionalTest::test_iterative_expectations
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/functional_test.py:68: DeprecationWarning: Please use assertEqual instead.
    assert_equals( 3, f.bar(3) )

tests/functional_test.py::FunctionalTest::test_iterative_expectations
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/functional_test.py:71: DeprecationWarning: Please use assertEqual instead.
    assert_equals( None, f.bar() )

tests/functional_test.py::FunctionalTest::test_iterative_expectations
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/functional_test.py:74: DeprecationWarning: Please use assertEqual instead.
    assert_equals( 4, f.bar() )

tests/functional_test.py::FunctionalTest::test_iterative_expectations
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/functional_test.py:75: DeprecationWarning: Please use assertEqual instead.
    assert_equals( 4, f.bar() )

tests/functional_test.py::FunctionalTest::test_iterative_expectations
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/functional_test.py:78: DeprecationWarning: Please use assertEqual instead.
    assert_equals( 5, f.bar() )

tests/functional_test.py::FunctionalTest::test_iterative_expectations
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/functional_test.py:83: DeprecationWarning: Please use assertEqual instead.
    assert_equals( 7, f.bar(6) )

tests/functional_test.py::FunctionalTest::test_iterative_expectations
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/functional_test.py:87: DeprecationWarning: Please use assertEqual instead.
    assert_equals( 8, f.bar() )

tests/functional_test.py::FunctionalTest::test_iterative_expectations
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/functional_test.py:88: DeprecationWarning: Please use assertEqual instead.
    assert_equals( 9, f.bar() )

tests/functional_test.py::FunctionalTest::test_iterative_expectations
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/functional_test.py:89: DeprecationWarning: Please use assertEqual instead.
    assert_equals( 9, f.bar() )

tests/functional_test.py::FunctionalTest::test_properties_using_attr_name_on_an_instance_only
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/functional_test.py:23: DeprecationWarning: Please use assertEqual instead.
    assert_equals( 'foo', foo.prop )

tests/functional_test.py::FunctionalTest::test_properties_using_obj_ref_on_a_class_and_using_get_first
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/functional_test.py:42: DeprecationWarning: Please use assertEqual instead.
    assert_equals( 'foo', Foo().prop )

tests/functional_test.py::FunctionalTest::test_properties_using_obj_ref_on_a_class_and_using_set_first
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/functional_test.py:59: DeprecationWarning: Please use assertEqual instead.
    assert_equals( 'foo', Foo().prop )

tests/mock_test.py::MockTest::test_call_not_raises_unexpectedcall_when_stubbed
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/mock_test.py:64: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( 'success', m() )

tests/mock_test.py::MockTest::test_container_interface_when_stubbed
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/mock_test.py:100: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( 42, len(m) )

tests/mock_test.py::MockTest::test_container_interface_when_stubbed
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/mock_test.py:101: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( 'getitem', m['foo'] )

tests/mock_test.py::MockTest::test_container_interface_when_stubbed
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/mock_test.py:104: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( i, iter(m) )

tests/mock_test.py::MockTest::test_container_interface_when_stubbed
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/mock_test.py:105: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( 'backwards', reversed(m) )

tests/mock_test.py::MockTest::test_container_interface_when_stubbed
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/mock_test.py:106: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( True, 'foo' in m )

tests/mock_test.py::MockTest::test_get_attribute_auto_method_not_raises_unexpectedcall_multiple_depths
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/mock_test.py:50: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( 'success', m.foo.bar() )

tests/mock_test.py::MockTest::test_get_attribute_auto_method_not_raises_unexpectedcall_when_stubbed
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/mock_test.py:45: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( 'success', m.foo() )

tests/mock_test.py::MockTest::test_get_attribute_creates_a_mock_method
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/mock_test.py:20: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( 'mock', m._name )

tests/mock_test.py::MockTest::test_get_attribute_creates_a_mock_method
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/mock_test.py:23: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( 'mock.foo', m.foo._name )

tests/mock_test.py::MockTest::test_get_attribute_does_not_overwrite_existing_attr
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/mock_test.py:55: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals( 42, m.foo )

tests/sample_test.py::SampleBaseTest::test_almost_equals_comparator
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:265: DeprecationWarning: Please use assertEqual instead.
    assert_equals(obj.bound_method(10.12), 100)

tests/sample_test.py::SampleBaseTest::test_expect_unbound_method_acts_as_any_instance
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:193: DeprecationWarning: Please use assertEqual instead.
    assert_equals('world', obj2.bound_method('hello'))

tests/sample_test.py::SampleBaseTest::test_expect_unbound_method_acts_as_any_instance
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:194: DeprecationWarning: Please use assertEqual instead.
    assert_equals('mars', obj1.bound_method('hello'))

tests/sample_test.py::SampleBaseTest::test_expects_any_order_without_count_modifiers
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:121: DeprecationWarning: Please use assertEqual instead.
    assert_equals(4, obj.bound_method(3))

tests/sample_test.py::SampleBaseTest::test_expects_any_order_without_count_modifiers
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:122: DeprecationWarning: Please use assertEqual instead.
    assert_equals(4, obj.bound_method(3))

tests/sample_test.py::SampleBaseTest::test_expects_any_order_without_count_modifiers
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:123: DeprecationWarning: Please use assertEqual instead.
    assert_equals(2, obj.bound_method(1))

tests/sample_test.py::SampleBaseTest::test_expects_bound_method_at_least_as_last_expectation
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:83: DeprecationWarning: Please use assertEqual instead.
    assert_equals(12, obj.bound_method(1, 2))

tests/sample_test.py::SampleBaseTest::test_expects_bound_method_at_least_as_last_expectation
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:84: DeprecationWarning: Please use assertEqual instead.
    assert_equals(12, obj.bound_method(1, 2))

tests/sample_test.py::SampleBaseTest::test_expects_bound_method_at_least_as_last_expectation
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:85: DeprecationWarning: Please use assertEqual instead.
    assert_equals(12, obj.bound_method(1, 2))

tests/sample_test.py::SampleBaseTest::test_expects_bound_method_at_least_as_last_expectation
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:86: DeprecationWarning: Please use assertEqual instead.
    assert_equals(12, obj.bound_method(1, 2))

tests/sample_test.py::SampleBaseTest::test_expects_bound_method_at_least_with_other_expectation_and_anyorder
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:72: DeprecationWarning: Please use assertEqual instead.
    assert_equals(12, obj.bound_method(1, 2))

tests/sample_test.py::SampleBaseTest::test_expects_bound_method_at_least_with_other_expectation_and_anyorder
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:73: DeprecationWarning: Please use assertEqual instead.
    assert_equals(12, obj.bound_method(1, 2))

tests/sample_test.py::SampleBaseTest::test_expects_bound_method_at_least_with_other_expectation_and_anyorder
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:76: DeprecationWarning: Please use assertEqual instead.
    assert_equals(100, obj.bound_method(1, 3))

tests/sample_test.py::SampleBaseTest::test_expects_bound_method_at_least_with_other_expectation_and_anyorder
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:78: DeprecationWarning: Please use assertEqual instead.
    assert_equals(12, obj.bound_method(1, 2))

tests/sample_test.py::SampleBaseTest::test_expects_bound_method_at_least_with_other_expectation_and_no_anyorder
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:61: DeprecationWarning: Please use assertEqual instead.
    assert_equals(12, obj.bound_method(1, 2))

tests/sample_test.py::SampleBaseTest::test_expects_bound_method_at_least_with_other_expectation_and_no_anyorder
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:62: DeprecationWarning: Please use assertEqual instead.
    assert_equals(12, obj.bound_method(1, 2))

tests/sample_test.py::SampleBaseTest::test_expects_bound_method_at_least_with_other_expectation_and_no_anyorder
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:65: DeprecationWarning: Please use assertEqual instead.
    assert_equals(100, obj.bound_method(1, 3))

tests/sample_test.py::SampleBaseTest::test_expects_bound_method_at_most
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:91: DeprecationWarning: Please use assertEqual instead.
    assert_equals(12, obj.bound_method(1, 2))

tests/sample_test.py::SampleBaseTest::test_expects_bound_method_at_most
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:92: DeprecationWarning: Please use assertEqual instead.
    assert_equals(12, obj.bound_method(1, 2))

tests/sample_test.py::SampleBaseTest::test_expects_bound_method_can_be_used_for_iterative_testing
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:136: DeprecationWarning: Please use assertEqual instead.
    assert_equals(12, obj.bound_method(1, 2))

tests/sample_test.py::SampleBaseTest::test_expects_bound_method_can_be_used_for_iterative_testing
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:140: DeprecationWarning: Please use assertEqual instead.
    assert_equals(1100, obj.bound_method(1, 4))

tests/sample_test.py::SampleBaseTest::test_expects_bound_method_returns
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:53: DeprecationWarning: Please use assertEqual instead.
    assert_equals(12, obj.bound_method(1, 2))

tests/sample_test.py::SampleBaseTest::test_expects_bound_method_returns
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:56: DeprecationWarning: Please use assertEqual instead.
    assert_equals(1100, obj.bound_method(1, 4))

tests/sample_test.py::SampleBaseTest::test_expects_class_method
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:207: DeprecationWarning: Please use assertEqual instead.
    assert_equals(12, SampleBase.a_classmethod())

tests/sample_test.py::SampleBaseTest::test_expects_class_method
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:211: DeprecationWarning: Please use assertEqual instead.
    assert_equals(100, obj.a_classmethod())

tests/sample_test.py::SampleBaseTest::test_expects_on_builtin_function
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:48: DeprecationWarning: Please use assertEqual instead.
    assert_equals('ok', os.remove('foo'))

tests/sample_test.py::SampleBaseTest::test_expects_property
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:41: DeprecationWarning: Please use assertEqual instead.
    assert_equals("property value", obj.prop)

tests/sample_test.py::SampleBaseTest::test_function_comparator
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:253: DeprecationWarning: Please use assertEqual instead.
    assert_equals(obj.bound_method(100), 100)

tests/sample_test.py::SampleBaseTest::test_ignore_arg
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:248: DeprecationWarning: Please use assertEqual instead.
    assert_equals(obj.bound_method('first_name'), 100)

tests/sample_test.py::SampleBaseTest::test_in_comparator
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:258: DeprecationWarning: Please use assertEqual instead.
    assert_equals(obj.bound_method(['name', 'age']), 100)

tests/sample_test.py::SampleBaseTest::test_in_comparator
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:259: DeprecationWarning: Please use assertEqual instead.
    assert_equals(obj.bound_method({'name': 'vitaly'}), 100)

tests/sample_test.py::SampleBaseTest::test_in_comparator
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:260: DeprecationWarning: Please use assertEqual instead.
    assert_equals(obj.bound_method('lasfs-name-asfsad'), 100)

tests/sample_test.py::SampleBaseTest::test_is_comparator
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:270: DeprecationWarning: Please use assertEqual instead.
    assert_equals(obj.bound_method(obj), 100)

tests/sample_test.py::SampleBaseTest::test_regex_comparator
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:243: DeprecationWarning: Please use assertEqual instead.
    assert_equals(obj.bound_method('first_name'), 100)

tests/sample_test.py::SampleBaseTest::test_spy
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:295: DeprecationWarning: Please use assertEqual instead.
    assert_equals(['v1'], list(obj._deque))

tests/sample_test.py::SampleBaseTest::test_spy
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:299: DeprecationWarning: Please use assertEqual instead.
    assert_equals(['v1', 'v2'], list(obj._deque))

tests/sample_test.py::SampleBaseTest::test_spy
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:300: DeprecationWarning: Please use assertEqual instead.
    assert_equals('v2', var('value2').value)

tests/sample_test.py::SampleBaseTest::test_spy
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:309: DeprecationWarning: Please use assertEqual instead.
    assert_equals(['v1', 'v2', 'v3'], list(obj._deque))

tests/sample_test.py::SampleBaseTest::test_spy
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:310: DeprecationWarning: Please use assertEqual instead.
    assert_equals({'foo': 'bug'}, data)

tests/sample_test.py::SampleBaseTest::test_spy
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:319: DeprecationWarning: Please use assertEqual instead.
    assert_equals([0, 'v1', 'v2', 'v3', 'v4'], capture)

tests/sample_test.py::SampleBaseTest::test_var_comparator
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:284: DeprecationWarning: Please use assertEqual instead.
    assert_equals('v1', var('value1').value)

tests/sample_test.py::SampleBaseTest::test_var_comparator
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:285: DeprecationWarning: Please use assertEqual instead.
    assert_equals('v2', var('value2').value)

tests/sample_test.py::SampleBaseTest::test_var_comparator
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:286: DeprecationWarning: Please use assertEqual instead.
    assert_equals('v3', var('value3').value)

tests/sample_test.py::SampleBaseTest::tests_expects_bound_method_any_order_with_fixed_maxes
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:100: DeprecationWarning: Please use assertEqual instead.
    assert_equals(4, obj.bound_method(3))

tests/sample_test.py::SampleBaseTest::tests_expects_bound_method_any_order_with_fixed_maxes
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:101: DeprecationWarning: Please use assertEqual instead.
    assert_equals(2, obj.bound_method(1))

tests/sample_test.py::SampleBaseTest::tests_expects_bound_method_any_order_with_mins
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:108: DeprecationWarning: Please use assertEqual instead.
    assert_equals(4, obj.bound_method(3))

tests/sample_test.py::SampleBaseTest::tests_expects_bound_method_any_order_with_mins
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:109: DeprecationWarning: Please use assertEqual instead.
    assert_equals(2, obj.bound_method(1))

tests/sample_test.py::SampleBaseTest::tests_expects_bound_method_any_order_with_mins
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:110: DeprecationWarning: Please use assertEqual instead.
    assert_equals(4, obj.bound_method(3))

tests/sample_test.py::SampleBaseTest::tests_expects_bound_method_any_order_with_mins
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:111: DeprecationWarning: Please use assertEqual instead.
    assert_equals(2, obj.bound_method(1))

tests/sample_test.py::SampleBaseTest::tests_expects_bound_method_any_order_with_mins
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:112: DeprecationWarning: Please use assertEqual instead.
    assert_equals(2, obj.bound_method(1))

tests/sample_test.py::SampleBaseTest::tests_expects_bound_method_any_order_with_mins
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:113: DeprecationWarning: Please use assertEqual instead.
    assert_equals(4, obj.bound_method(3))

tests/sample_test.py::SampleBaseTest::tests_expects_bound_method_any_order_with_mins
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/sample_test.py:114: DeprecationWarning: Please use assertEqual instead.
    assert_equals(2, obj.bound_method(1))

tests/stub_test.py::StubTest::test_stub_bound_method_for_classmethod_with_attr_name
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:166: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res, stub(Foo,'bar'))

tests/stub_test.py::StubTest::test_stub_bound_method_for_classmethod_with_attr_name
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:167: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res, getattr(Foo,'bar'))

tests/stub_test.py::StubTest::test_stub_bound_method_for_classmethod_with_obj_ref
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:176: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res, stub(Foo.bar))

tests/stub_test.py::StubTest::test_stub_bound_method_for_classmethod_with_obj_ref
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:177: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res, getattr(Foo,'bar'))

tests/stub_test.py::StubTest::test_stub_bound_method_for_instance_with_attr_name
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:139: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res._instance, foo)

tests/stub_test.py::StubTest::test_stub_bound_method_for_instance_with_attr_name
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:140: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res._obj, orig)

tests/stub_test.py::StubTest::test_stub_bound_method_for_instance_with_attr_name
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:141: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res._attr, 'bar')

tests/stub_test.py::StubTest::test_stub_bound_method_for_instance_with_attr_name
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:142: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res, stub(foo,'bar'))

tests/stub_test.py::StubTest::test_stub_bound_method_for_instance_with_attr_name
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:143: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res, getattr(foo,'bar'))

tests/stub_test.py::StubTest::test_stub_bound_method_for_instance_with_obj_ref
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:153: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res._instance, foo)

tests/stub_test.py::StubTest::test_stub_bound_method_for_instance_with_obj_ref
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:154: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res._obj, orig)

tests/stub_test.py::StubTest::test_stub_bound_method_for_instance_with_obj_ref
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:155: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res._attr, 'bar')

tests/stub_test.py::StubTest::test_stub_bound_method_for_instance_with_obj_ref
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:156: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res, stub(foo.bar))

tests/stub_test.py::StubTest::test_stub_bound_method_for_instance_with_obj_ref
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:157: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res, getattr(foo,'bar'))

tests/stub_test.py::StubTest::test_stub_method_wrapper_with_attr_name
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:186: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res, stub(foo, '__hash__'))

tests/stub_test.py::StubTest::test_stub_method_wrapper_with_attr_name
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:187: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res, getattr(foo, '__hash__'))

tests/stub_test.py::StubTest::test_stub_method_wrapper_with_obj_ref
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:196: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res, stub(foo.__hash__))

tests/stub_test.py::StubTest::test_stub_method_wrapper_with_obj_ref
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:197: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res, getattr(foo, '__hash__'))

tests/stub_test.py::StubTest::test_stub_mock_with_attr_name
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:83: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res, f.bar.__call__)

tests/stub_test.py::StubTest::test_stub_mock_with_attr_name
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:84: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res, stub(f, 'bar'))

tests/stub_test.py::StubTest::test_stub_mock_with_obj_ref
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:94: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res, f.bar.__call__)

tests/stub_test.py::StubTest::test_stub_mock_with_obj_ref
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:95: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res, stub(f.bar))

tests/stub_test.py::StubTest::test_stub_module_function_with_attr_name
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:202: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res, getattr(samples,'mod_func_1'))

tests/stub_test.py::StubTest::test_stub_module_function_with_attr_name
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:203: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res, stub(samples,'mod_func_1'))

tests/stub_test.py::StubTest::test_stub_module_function_with_obj_ref
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:209: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res, getattr(samples,'mod_func_1'))

tests/stub_test.py::StubTest::test_stub_module_function_with_obj_ref
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:210: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res, samples.mod_func_1)

tests/stub_test.py::StubTest::test_stub_module_function_with_obj_ref
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:211: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res, stub(samples.mod_func_1))

tests/stub_test.py::StubTest::test_stub_type_with_obj_ref
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:103: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res, Foo.__new__)

tests/stub_test.py::StubTest::test_stub_type_with_obj_ref
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:104: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res, stub(Foo))

tests/stub_test.py::StubTest::test_stub_type_with_obj_ref
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:108: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(1, len(res._expectations))

tests/stub_test.py::StubTest::test_stub_type_with_obj_ref
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:110: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(1, len(res._expectations))

tests/stub_test.py::StubTest::test_stub_unbound_method_with_attr_name
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:118: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res, stub(Foo,'bar'))

tests/stub_test.py::StubTest::test_stub_unbound_method_with_attr_name
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:119: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(res, getattr(Foo,'bar'))

tests/stub_test.py::StubClassTest::test_call_raises_unexpected_call_when_closed_and_no_matching
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:294: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(0, s._expectations[0]._match_count)

tests/stub_test.py::StubClassTest::test_call_raises_unexpected_call_when_closed_and_no_matching
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:295: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(1, s._expectations[1]._match_count)

tests/stub_test.py::StubClassTest::test_call_raises_unexpected_call_when_closed_and_no_matching
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:296: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(0, s._expectations[0]._close_count)

tests/stub_test.py::StubClassTest::test_call_raises_unexpected_call_when_closed_and_no_matching
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:297: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(0, s._expectations[1]._close_count)

tests/stub_test.py::StubClassTest::test_call_when_args_match
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:262: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals('success', s('foo'))

tests/stub_test.py::StubClassTest::test_expect
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:239: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals([], s._expectations)

tests/stub_test.py::StubClassTest::test_expect
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:241: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals([e], s._expectations)

tests/stub_test.py::StubClassTest::test_expect
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:242: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(s, e._stub)

tests/stub_test.py::StubClassTest::test_init
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:220: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals('obj', s._obj)

tests/stub_test.py::StubClassTest::test_init
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:221: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals('attr', s._attr)

tests/stub_test.py::StubClassTest::test_init
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:222: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals([], s._expectations)

tests/stub_test.py::StubClassTest::test_teardown
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:234: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals([], s._expectations)

tests/stub_test.py::StubPropertyTest::test_name
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:308: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(s.name, 'Foo.prop')

tests/stub_test.py::StubMethodTest::test_call_orig
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:353: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(3, sa.call_orig())

tests/stub_test.py::StubMethodTest::test_call_orig
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:355: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(5, sa.call_orig())

tests/stub_test.py::StubMethodTest::test_init
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:319: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(s._obj, orig)

tests/stub_test.py::StubMethodTest::test_init
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:320: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(s._instance, f)

tests/stub_test.py::StubMethodTest::test_init
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:321: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(s._attr, 'bar')

tests/stub_test.py::StubMethodTest::test_init
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:322: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(s, getattr(f,'bar'))

tests/stub_test.py::StubMethodTest::test_init
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:327: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(s._obj, orig)

tests/stub_test.py::StubMethodTest::test_init
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:328: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(s._instance, f)

tests/stub_test.py::StubMethodTest::test_init
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:329: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(s._attr, 'bar')

tests/stub_test.py::StubMethodTest::test_init
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:330: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(s, getattr(f,'bar'))

tests/stub_test.py::StubMethodTest::test_name
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:337: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals("Expect.closed", s.name)

tests/stub_test.py::StubMethodTest::test_name
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:341: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals("Expect.closed", s.name)

tests/stub_test.py::StubMethodTest::test_teardown
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:365: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(orig, f.bar)

tests/stub_test.py::StubMethodTest::test_teardown_of_bound_instance_methods_exported_in_module
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:381: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(orig, samples.mod_instance_foo)

tests/stub_test.py::StubFunctionTest::test_call_orig
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:405: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(12, s.call_orig(4))

tests/stub_test.py::StubFunctionTest::test_init
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:387: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(s._instance, samples)

tests/stub_test.py::StubFunctionTest::test_init
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:388: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(s._attr, 'mod_func_1')

tests/stub_test.py::StubFunctionTest::test_init
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:389: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(s, samples.mod_func_1)

tests/stub_test.py::StubFunctionTest::test_init
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:390: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(False, s._was_object_method)

tests/stub_test.py::StubFunctionTest::test_init_with_object_method
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:396: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(True, s._was_object_method)

tests/stub_test.py::StubFunctionTest::test_name
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:400: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals('tests.samples.mod_func_1', s.name)

tests/stub_test.py::StubFunctionTest::test_teardown
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:412: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(orig, samples.mod_func_1)

tests/stub_test.py::StubFunctionTest::test_teardown_on_object_method
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:416: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(object.__new__, getattr(x, '__new__'))

tests/stub_test.py::StubFunctionTest::test_teardown_on_object_method
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:418: DeprecationWarning: Please use assertNotEqual instead.
    self.assertNotEquals(object.__new__, getattr(x, '__new__'))

tests/stub_test.py::StubFunctionTest::test_teardown_on_object_method
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:420: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(object.__new__, getattr(x, '__new__'))

tests/stub_test.py::StubNewTest::test_call
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:452: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals('success', Foo('state', a='b'))

tests/stub_test.py::StubNewTest::test_init
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:438: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(s._instance, Foo)

tests/stub_test.py::StubNewTest::test_init
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:439: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(s._attr, '__new__')

tests/stub_test.py::StubNewTest::test_init
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:440: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(s, Foo.__new__)

tests/stub_test.py::StubUnboundMethodTest::test_call_acts_as_any_instance
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:547: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(2, s.calls)

tests/stub_test.py::StubUnboundMethodTest::test_init
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:509: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(s._instance, Foo)

tests/stub_test.py::StubUnboundMethodTest::test_init
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:510: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(s._attr, 'bar')

tests/stub_test.py::StubUnboundMethodTest::test_init
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:511: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(s, getattr(Foo,'bar'))

tests/stub_test.py::StubUnboundMethodTest::test_name
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:518: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals("Expect.closed", s.name)

tests/stub_test.py::StubUnboundMethodTest::test_teardown
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:528: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(orig, Foo.bar)

tests/stub_test.py::StubMethodWrapperTest::test_call_orig
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:578: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(3, sg.call_orig())

tests/stub_test.py::StubMethodWrapperTest::test_call_orig
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:580: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(5, sg.call_orig())

tests/stub_test.py::StubMethodWrapperTest::test_init
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:556: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(s._instance, foo)

tests/stub_test.py::StubMethodWrapperTest::test_init
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:557: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(s._attr, '__hash__')

tests/stub_test.py::StubMethodWrapperTest::test_init
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:558: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(s, getattr(foo,'__hash__'))

tests/stub_test.py::StubMethodWrapperTest::test_name
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:565: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals("Foo.__hash__", s.name)

tests/stub_test.py::StubMethodWrapperTest::test_teardown
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:588: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(orig, obj.__hash__)

tests/stub_test.py::StubWrapperDescriptionTest::test_call_orig
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:615: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(foo_str, s.call_orig())

tests/stub_test.py::StubWrapperDescriptionTest::test_init
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:596: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(s._obj, Foo)

tests/stub_test.py::StubWrapperDescriptionTest::test_init
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:597: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(s._attr, '__hash__')

tests/stub_test.py::StubWrapperDescriptionTest::test_init
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:598: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(s, getattr(Foo,'__hash__'))

tests/stub_test.py::StubWrapperDescriptionTest::test_name
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:604: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals("Foo.__hash__", s.name)

tests/stub_test.py::StubWrapperDescriptionTest::test_teardown
  /home/tkloczko/rpmbuild/BUILD/chai-1.1.2/tests/stub_test.py:623: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(orig, Foo.__hash__)

-- Docs: https://docs.pytest.org/en/stable/warnings.html
========================================================================= short test summary info ==========================================================================
SKIPPED [1] tests/stub_test.py:121: can't stub unbound methods by reference in python 3
SKIPPED [1] tests/stub_test.py:455: can't stub unbound methods in python 3
SKIPPED [1] tests/stub_test.py:424: can't stub unbound methods in python 3
SKIPPED [1] tests/stub_test.py:469: can't stub unbound methods in python 3
SKIPPED [1] tests/stub_test.py:481: can't stub unbound methods in python 3
=============================================================== 192 passed, 5 skipped, 238 warnings in 0.49s ===============================================================
``

Add inject_args to spies

There are cases where one wants to use a spy as a means to hook into the call stack and change a parameter to alter the behavior of code further down the stack. One option would be to attach a side_effect to a previous spy or expectation, and use that side effect to alter the state of the module to be called on a subsequent execution of a spy. However, that's not always feasible and can be challenging to understand when reading a test.

This proposal is for a new method, inject_args, that would allow the user to hook into the spy and change the arguments. Probably the easiest approach is for this to accept a callable parameter, and give the user complete control over how to transform the original *args, **kwargs into what's needed for the test.

Python 3 support?

Hello! I saw on Pypi that Chai supports Python 3.0, 3.1 and 3.2.

Here's what happens when I try to install it using pip:

3.0.1:

$ python --version && pip --version && pip install chai
Python 3.0.1
pip 1.2.1 from /home/richard/.pythonbrew/venvs/Python-3.0.1/arrow-3.0.1/lib/python3.0/site-packages/pip-1.2.1-py3.0.egg (python 3.0)
Downloading/unpacking chai
  Downloading chai-0.3.2.tar.gz
  Running setup.py egg_info for package chai
Downloading/unpacking termcolor (from chai)
  Downloading termcolor-1.1.0.tar.gz
  Running setup.py egg_info for package termcolor
Downloading/unpacking unittest2 (from chai)
  Downloading unittest2-0.5.1.zip (78kB): 78kB downloaded
  Running setup.py egg_info for package unittest2
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "/home/richard/.pythonbrew/venvs/Python-3.0.1/arrow-3.0.1/build/unittest2/setup.py", line 12, in <module>
        from unittest2 import __version__ as VERSION
      File "unittest2/__init__.py", line 40, in <module>
        from unittest2.collector import collector
      File "unittest2/collector.py", line 3, in <module>
        from unittest2.loader import defaultTestLoader
      File "unittest2/loader.py", line 92
        except Exception, e:
                        ^
    SyntaxError: invalid syntax
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 16, in <module>

  File "/home/richard/.pythonbrew/venvs/Python-3.0.1/arrow-3.0.1/build/unittest2/setup.py", line 12, in <module>

    from unittest2 import __version__ as VERSION

  File "unittest2/__init__.py", line 40, in <module>

    from unittest2.collector import collector

  File "unittest2/collector.py", line 3, in <module>

    from unittest2.loader import defaultTestLoader

  File "unittest2/loader.py", line 92

    except Exception, e:

                    ^

SyntaxError: invalid syntax

----------------------------------------
Command python setup.py egg_info failed with error code 1 in /home/richard/.pythonbrew/venvs/Python-3.0.1/arrow-3.0.1/build/unittest2
Storing complete log in /home/richard/.pip/pip.log

3.1.4:

$ python --version && pip --version && pip install chai
Python 3.1.4
pip 1.2.1 from /home/richard/.pythonbrew/venvs/Python-3.1.4/arrow-3.1.4/lib/python3.1/site-packages/pip-1.2.1-py3.1.egg (python 3.1)
Downloading/unpacking chai
  Real name of requirement chai is chai
  Downloading chai-0.3.2.tar.gz
  Running setup.py egg_info for package chai

Downloading/unpacking termcolor (from chai)
  Real name of requirement termcolor is termcolor
  Downloading termcolor-1.1.0.tar.gz
  Running setup.py egg_info for package termcolor

Downloading/unpacking unittest2 (from chai)
  Real name of requirement unittest2 is unittest2
  Downloading unittest2-0.5.1.zip (78kB): 78kB downloaded
  Running setup.py egg_info for package unittest2
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "/home/richard/.pythonbrew/venvs/Python-3.1.4/arrow-3.1.4/build/unittest2/setup.py", line 12, in <module>
        from unittest2 import __version__ as VERSION
      File "unittest2/__init__.py", line 40, in <module>
        from unittest2.collector import collector
      File "unittest2/collector.py", line 3, in <module>
        from unittest2.loader import defaultTestLoader
      File "unittest2/loader.py", line 92
        except Exception, e:
                        ^
    SyntaxError: invalid syntax
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 16, in <module>

  File "/home/richard/.pythonbrew/venvs/Python-3.1.4/arrow-3.1.4/build/unittest2/setup.py", line 12, in <module>

    from unittest2 import __version__ as VERSION

  File "unittest2/__init__.py", line 40, in <module>

    from unittest2.collector import collector

  File "unittest2/collector.py", line 3, in <module>

    from unittest2.loader import defaultTestLoader

  File "unittest2/loader.py", line 92

    except Exception, e:

                    ^

SyntaxError: invalid syntax

----------------------------------------
Command python setup.py egg_info failed with error code 1 in /home/richard/.pythonbrew/venvs/Python-3.1.4/arrow-3.1.4/build/unittest2
Storing complete log in /home/richard/.pip/pip.log

3.2.3:

$ python --version && pip --version && pip install chai
Python 3.2.3
pip 1.2.1 from /home/richard/.pythonbrew/venvs/Python-3.2.3/arrow-3.2.3/lib/python3.2/site-packages/pip-1.2.1-py3.2.egg (python 3.2)
Downloading/unpacking chai
  Downloading chai-0.3.2.tar.gz
  Running setup.py egg_info for package chai

Downloading/unpacking termcolor (from chai)
  Downloading termcolor-1.1.0.tar.gz
  Running setup.py egg_info for package termcolor

Downloading/unpacking unittest2 (from chai)
  Downloading unittest2-0.5.1.zip (78kB): 78kB downloaded
  Running setup.py egg_info for package unittest2
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "/home/richard/.pythonbrew/venvs/Python-3.2.3/arrow-3.2.3/build/unittest2/setup.py", line 12, in <module>
        from unittest2 import __version__ as VERSION
      File "unittest2/__init__.py", line 40, in <module>
        from unittest2.collector import collector
      File "unittest2/collector.py", line 3, in <module>
        from unittest2.loader import defaultTestLoader
      File "unittest2/loader.py", line 92
        except Exception, e:
                        ^
    SyntaxError: invalid syntax
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 16, in <module>

  File "/home/richard/.pythonbrew/venvs/Python-3.2.3/arrow-3.2.3/build/unittest2/setup.py", line 12, in <module>

    from unittest2 import __version__ as VERSION

  File "unittest2/__init__.py", line 40, in <module>

    from unittest2.collector import collector

  File "unittest2/collector.py", line 3, in <module>

    from unittest2.loader import defaultTestLoader

  File "unittest2/loader.py", line 92

    except Exception, e:

                    ^

SyntaxError: invalid syntax

----------------------------------------
Command python setup.py egg_info failed with error code 1 in /home/richard/.pythonbrew/venvs/Python-3.2.3/arrow-3.2.3/build/unittest2
Storing complete log in /home/richard/.pip/pip.log

Is there something wrong with my installation? Or is there another installation / branch for Py3k?

Best regards,
Richard.

Fix unstubbing of __new__

This seems to be working. In writing tests for https://github.com/agoragames/torus , it seems that an expectation on the Timeseries type was not cleaned up properly, and resulted in the following error for a test that didn't try to mock out that constructor.

======================================================================
ERROR: test_match_list (test.unit.schema_test.SchemaTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/aaron/.virtualenvs/torus/local/lib/python2.7/site-packages/chai/chai.py", line 57, in wrapper
    func(self, *args, **kwargs)
  File "/home/aaron/projects/torus/test/unit/schema_test.py", line 70, in test_match_list
    s = Schema('name', config)
  File "/home/aaron/projects/torus/torus/schema.py", line 53, in __init__
    self.timeseries = Timeseries(self._client, **config)
TypeError: unbound method __new__() must be called with Timeseries instance as first argument (got type instance instead)

Tests fail on python 3

The unit-tests of chai 1.0.0 are failing for python3 when called via python3 setup.py test

Nest expectations on return values

In python-mock library, return_value can be used to chain expectations (as it is also a mock), example:

    def test_mongo_db_api_connects_to_mongo(self):
        with mock.patch('pymongo.Connection') as mock_conn:
            stub_cursor = "whatever"
            mock_conn.return_value.__getitem__ = mock.MagicMock()
            mock_conn.return_value.__getitem__.return_value.__getitem__.return_value = stub_cursor

            api = MongoDbApi(database_name='dbname', collection_name='collection')
            self.assertEquals(api.cursor, stub_cursor)

            mock_conn.assert_called_with({'host':'localhost'})
            mock_conn.return_value.__getitem__.assert_called_with('dbname')
            mock_conn.return_value.__getitem__.return_value.__getitem__.assert_called_with('collection')

would be nice if something similar was available in chai, maybe like this:

    def test_mongo_db_api_connects_to_mongo(self):
        stub_cursor = stub("whatever")
        expect(pymongo.Connection).args({'host':'localhost'}).\
                return_stub.expect('__getitem__').args('dbname').\
                return_stub.expect('__getitem__').args('collection').\
                returns( stub_cursor )
        api = MongoDbApi(database_name='dbname', collection_name='collection')
        assert_equals(api.cursor, stub_cursor)

It does behave a bit different though, since the object that receives the method now has an .expect() method which is different from how Chai usually sets expectations on objects, but on other hand it looks so cool! :)

Deprecation warnings with py3 tests

In the various tests there is assertEquals which returns a deprecation warning on Python 3, no issues with Python 2. This was discovered during packaging for OpenBSD.

Here are the errors grepped out of the test output:

test_call_not_raises_unexpectedcall_when_stubbed (tests.mock_test.MockTest) ... /usr/ports/pobj/py-chai-1.1.2-python3/chai-1.1.2/tests/mock_test.py:64: DeprecationWarning: Please use assertEqual instead.
  self.assertEquals( 'success', m() )
ok
test_almost_equals_comparator (tests.sample_test.SampleBaseTest) ... /usr/ports/pobj/py-chai-1.1.2-python3/chai-1.1.2/tests/sample_test.py:265: DeprecationWarning: Please use assertEqual instead.
  assert_equals(obj.bound_method(10.12), 100)
ok
test_iterative_expectations (tests.functional_test.FunctionalTest) ... /usr/ports/pobj/py-chai-1.1.2-python3/chai-1.1.2/tests/functional_test.py:68: DeprecationWarning: Please use assertEqual instead.
  assert_equals( 3, f.bar(3) )
ok
test_call_raises_unexpected_call_when_closed_and_no_matching (tests.stub_test.StubClassTest) ... /usr/ports/pobj/py-chai-1.1.2-python3/chai-1.1.2/tests/stub_test.py:294: DeprecationWarning: Please use assertEqual instead.
  self.assertEquals(0, s._expectations[0]._match_count)
ok
test_teardown_on_object_method (tests.stub_test.StubFunctionTest) ... /usr/ports/pobj/py-chai-1.1.2-python3/chai-1.1.2/tests/stub_test.py:418: DeprecationWarning: Please use assertNotEqual instead.
  self.assertNotEquals(object.__new__, getattr(x, '__new__'))
ok
test_expect (tests.chai_test.ChaiTest) ... /usr/ports/pobj/py-chai-1.1.2-python3/chai-1.1.2/tests/chai_test.py:106: DeprecationWarning: Please use assertEqual instead.
  self.assertEquals( deque(), case._stubs )
ok
test_any_order (tests.expectation_test.ExpectationRule) ... /usr/ports/pobj/py-chai-1.1.2-python3/chai-1.1.2/tests/expectation_test.py:128: DeprecationWarning: Please use assertEqual instead.
  self.assertEquals( exp, exp.any_order().times(1) )
ok
test_all (tests.comparator_test.ComparatorsTest) ... /usr/ports/pobj/py-chai-1.1.2-python3/chai-1.1.2/tests/comparator_test.py:152: DeprecationWarning: Please use assertEqual instead.
  self.assertEquals( 'foo'.encode('ascii'), bytearray('foo'.encode('ascii')) )
ok

They do not fail the tests as shown, but it would be nice to have clean tests if possible.

Tests require 2.7

Running the tests on an older python leads to the traceback:

 "tests/comparator_test.py", line 7, in <module>
    if sys.version_info.major==2:

According to the documentation http://docs.python.org/2/library/sys.html#sys.version_info the named component attributes have only been added on py2.7.

This contradicts the version set to be supported in the setup.py

I don't have time to submit a pull request to fix this this week but it should as simple as replacing the lines by:

sys.version_info[0]==2

chai pollutes the global module namespace

It's setUp() method pollutes the global namespace of any module using a TestCase inherited from Chai. It adds 'stub', 'expect', 'mock' and copies of all unittest.TestCase 'assert*' methods to the global module namespace from within its setUp() method.

It silently overwrites existing global names.

IMNSHO, this is a reason never to allow chai in your code base at all.

example: Have "from unittest import mock" in your test file? Sorry, you can't do that with chai. Chai overwrites that 'mock' with its own mock when setUp() is called.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.