From 5000787c185718ec3096bb6473cadeaa409a8278 Mon Sep 17 00:00:00 2001 From: meejah Date: Thu, 1 Mar 2018 20:51:35 -0700 Subject: [PATCH] flake8 --- src/allmydata/client.py | 1 - src/allmydata/test/test_client.py | 3 +-- src/allmydata/test/test_node.py | 8 ++++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/allmydata/client.py b/src/allmydata/client.py index 4d853da43..77643d205 100644 --- a/src/allmydata/client.py +++ b/src/allmydata/client.py @@ -28,7 +28,6 @@ from allmydata.history import History from allmydata.interfaces import IStatsProducer, SDMF_VERSION, MDMF_VERSION from allmydata.nodemaker import NodeMaker from allmydata.blacklist import Blacklist -from allmydata import node KiB=1024 diff --git a/src/allmydata/test/test_client.py b/src/allmydata/test/test_client.py index 0178c7e6c..d1caeb1f3 100644 --- a/src/allmydata/test/test_client.py +++ b/src/allmydata/test/test_client.py @@ -216,7 +216,6 @@ class Basic(testutil.ReallyEqualMixin, testutil.NonASCIIPathMixin, unittest.Test def test_web_apiauthtoken(self): basedir = u"client.Basic.test_web_apiauthtoken" create_node_dir(basedir, "testing") - config = read_config(basedir, "portnum") c = client.create_client(basedir) # this must come after we create the client, as it will create @@ -255,7 +254,7 @@ class Basic(testutil.ReallyEqualMixin, testutil.NonASCIIPathMixin, unittest.Test 'host_privkey_file = privkey\n' ) with mock.patch('allmydata.frontends.sftpd.SFTPServer') as p: - c = client.create_client(basedir) + client.create_client(basedir) self.assertTrue(p.called) def test_ftp_auth_keyfile(self): diff --git a/src/allmydata/test/test_node.py b/src/allmydata/test/test_node.py index b0df47f95..f81869536 100644 --- a/src/allmydata/test/test_node.py +++ b/src/allmydata/test/test_node.py @@ -141,7 +141,7 @@ class TestCase(testutil.SignalMixin, unittest.TestCase): basedir = u"test_node/test_config_required" config = read_config(basedir, "portnum") - with self.assertRaises(Exception) as ctx: + with self.assertRaises(Exception): config.get_config_from_file("it_does_not_exist", required=True) def test_private_config_unreadable(self): @@ -152,7 +152,7 @@ class TestCase(testutil.SignalMixin, unittest.TestCase): fname = os.path.join(basedir, "private", "foo") os.chmod(fname, 0) - with self.assertRaises(Exception) as ctx: + with self.assertRaises(Exception): config.get_or_create_private_config("foo") def test_private_config_unreadable_preexisting(self): @@ -164,7 +164,7 @@ class TestCase(testutil.SignalMixin, unittest.TestCase): f.write("stuff") os.chmod(fname, 0) - with self.assertRaises(Exception) as ctx: + with self.assertRaises(Exception): config.get_private_config("foo") def test_private_config_missing(self): @@ -172,7 +172,7 @@ class TestCase(testutil.SignalMixin, unittest.TestCase): create_node_dir(basedir, "testing") config = read_config(basedir, "portnum") - with self.assertRaises(MissingConfigEntry) as ctx: + with self.assertRaises(MissingConfigEntry): config.get_or_create_private_config("foo") def test_private_config(self):