diff --git a/lbrynet/reflector/client/client.py b/lbrynet/reflector/client/client.py index d6631b8de..72d353085 100644 --- a/lbrynet/reflector/client/client.py +++ b/lbrynet/reflector/client/client.py @@ -235,7 +235,7 @@ class LBRYFileReflectorClient(Protocol): else: # close connection log.debug('No more blob hashes, closing connection') - self.transport.closeConnection() + self.transport.loseConnection() class LBRYFileReflectorClientFactory(ClientFactory): diff --git a/tests/unit/core/test_LBRYExchangeRateManager.py b/tests/unit/core/test_LBRYExchangeRateManager.py index 2a6457536..e07b49194 100644 --- a/tests/unit/core/test_LBRYExchangeRateManager.py +++ b/tests/unit/core/test_LBRYExchangeRateManager.py @@ -19,12 +19,10 @@ class LBRYFeeFormatTest(unittest.TestCase): class LBRYFeeTest(unittest.TestCase): def setUp(self): - self.patcher = mock.patch('time.time') - self.time = self.patcher.start() + patcher = mock.patch('time.time') + self.time = patcher.start() self.time.return_value = 0 - - def tearDown(self): - self.time.stop() + self.addCleanup(patcher.stop) def test_fee_converts_to_lbc(self): fee_dict = { @@ -35,4 +33,4 @@ class LBRYFeeTest(unittest.TestCase): } rates = {'BTCLBC': {'spot': 3.0, 'ts': 2}, 'USDBTC': {'spot': 2.0, 'ts': 3}} manager = LBRYExchangeRateManager.DummyExchangeRateManager(rates) - self.assertEqual(60.0, manager.to_lbc(fee_dict).amount) \ No newline at end of file + self.assertEqual(60.0, manager.to_lbc(fee_dict).amount)