diff --git a/tests/unit/stream/test_stream_manager.py b/tests/unit/stream/test_stream_manager.py index 65d35e945..a3967a844 100644 --- a/tests/unit/stream/test_stream_manager.py +++ b/tests/unit/stream/test_stream_manager.py @@ -122,6 +122,10 @@ async def get_mock_wallet(sd_hash, storage, balance=10.0, fee=None): class TestStreamManager(BlobExchangeTestBase): + async def asyncSetUp(self): + await super().asyncSetUp() + self.client_config.share_usage_data = True + async def setup_stream_manager(self, balance=10.0, fee=None, old_sort=False): file_path = os.path.join(self.server_dir, "test_file") with open(file_path, 'wb') as f: diff --git a/tests/unit/test_cli.py b/tests/unit/test_cli.py index c17ae6476..76616d298 100644 --- a/tests/unit/test_cli.py +++ b/tests/unit/test_cli.py @@ -80,27 +80,25 @@ class CLILoggingTest(AsyncioTestCase): self.assertFalse(log.getChild("torba").isEnabledFor(logging.DEBUG)) async def test_loggly(self): - async with get_logger(["start"], share_usage_data=False) as log: + async with get_logger(["start"]) as log: # default share_usage_data=False self.assertEqual(len(log.getChild("lbry").handlers), 2) # file and console - async with get_logger(["start"]) as log: # default share_usage_data=True + async with get_logger(["start"], share_usage_data=True) as log: log = log.getChild("lbry") self.assertEqual(len(log.handlers), 3) self.assertIsInstance(log.handlers[2], HTTPSLogglyHandler) - async with get_logger(["start"], share_usage_data=True) as log: # explicit share_usage_data=True + async with get_logger(["start"], share_usage_data=False) as log: # explicit share_usage_data=False log = log.getChild("lbry") - self.assertEqual(len(log.handlers), 3) - self.assertIsInstance(log.handlers[2], HTTPSLogglyHandler) + self.assertEqual(len(log.handlers), 2) async def test_quiet(self): async with get_logger(["start"]) as log: # default is loud log = log.getChild("lbry") - self.assertEqual(len(log.handlers), 3) + self.assertEqual(len(log.handlers), 2) self.assertIs(type(log.handlers[1]), logging.StreamHandler) async with get_logger(["start", "--quiet"]) as log: log = log.getChild("lbry") - self.assertEqual(len(log.handlers), 2) + self.assertEqual(len(log.handlers), 1) self.assertIsNot(type(log.handlers[0]), logging.StreamHandler) - self.assertIsNot(type(log.handlers[1]), logging.StreamHandler) class CLITest(AsyncioTestCase):