diff --git a/autobahn/twisted/test/test_application_runner.py b/autobahn/twisted/test/test_application_runner.py index 42f8c17c..a0bdf99b 100644 --- a/autobahn/twisted/test/test_application_runner.py +++ b/autobahn/twisted/test/test_application_runner.py @@ -52,8 +52,8 @@ if os.environ.get('USE_TWISTED', False): self.assertRaises(RuntimeError, runner.run, raise_error) # both reactor.run and reactor.stop should have been called - fakereactor.run.assert_called() - fakereactor.stop.assert_called() + self.assertEqual(fakereactor.run.call_count, 1) + self.assertEqual(fakereactor.stop.call_count, 1) @patch('twisted.internet.reactor') @inlineCallbacks @@ -71,8 +71,8 @@ if os.environ.get('USE_TWISTED', False): # neither reactor.run() NOR reactor.stop() should have been called # (just connectTCP() will have been called) - fakereactor.run.assert_not_called() - fakereactor.stop.assert_not_called() + self.assertEqual(fakereactor.run.call_count, 0) + self.assertEqual(fakereactor.stop.call_count, 0) @patch('twisted.internet.reactor') def test_runner_no_run_happypath(self, fakereactor): @@ -90,8 +90,8 @@ if os.environ.get('USE_TWISTED', False): # neither reactor.run() NOR reactor.stop() should have been called # (just connectTCP() will have been called) - fakereactor.run.assert_not_called() - fakereactor.stop.assert_not_called() + self.assertEqual(fakereactor.run.call_count, 0) + self.assertEqual(fakereactor.stop.call_count, 0) if __name__ == '__main__': unittest.main() diff --git a/tox.ini b/tox.ini index 56447d90..ec5b2181 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,9 @@ [tox] -envlist = flake8, {pypy,py27,py33}-{twtrunk,trollius}, {py34}-{twtrunk,asyncio}, {pypy,py26,py27}-{tw122,tw132,twcurrent}, +envlist = + flake8 + {pypy,py27,py33}-{twtrunk,trollius} + {py34}-{twtrunk,asyncio} + {pypy,py26,py27}-{tw122,tw132,twcurrent} [testenv] deps =