pep8/pyflakes corrections

This commit is contained in:
Martin A. Brown 2016-02-17 19:36:52 -08:00
parent ef355ad8fb
commit 875e2b2c23
3 changed files with 5 additions and 11 deletions

View File

@ -3,15 +3,9 @@ from __future__ import absolute_import, division, print_function
import os
import time
import errno
import random
import shutil
try:
from types import SimpleNamespace
except ImportError:
from utils import SimpleNamespace
from tldp.outputs import OutputNamingConvention
from tldptesttools import TestToolsFilesystem
@ -52,7 +46,7 @@ class TestSourceDocSkeleton(object):
shutil.copy(content, fname)
else:
with open(fname, 'w') as f:
f.write(content)
f.write(content)
class TestInventoryBase(TestToolsFilesystem):
@ -154,7 +148,7 @@ class TestInventoryUsage(TestInventoryBase):
self.assertEquals(0, len(i.orphans))
self.assertEquals(0, len(i.broken))
def test_detect_status_stale(self):
def test_detect_status_broken(self):
ex = random.choice(example.sources)
self.add_broken('Frobnitz-HOWTO', ex)
i = Inventory(self.pubdir, self.sourcedirs)

View File

@ -67,7 +67,7 @@ class TestOutputDirectory(TestToolsFilesystem):
for prop in o.expected:
fname = getattr(o, prop, None)
assert fname is not None
with open(fname, 'w') as f:
with open(fname, 'w'):
pass
self.assertTrue(o.iscomplete)

View File

@ -10,7 +10,7 @@ from tldptesttools import TestToolsFilesystem
# -- SUT
from tldp.utils import makefh, which, execute
from tldp.utils import statfiles, att_statinfo
from tldp.utils import statfiles
class Test_execute(TestToolsFilesystem):
@ -82,7 +82,6 @@ class Test_statfiles(unittest.TestCase):
self.assertTrue(os.path.basename(__file__) in statinfo)
def test_statfiles_file_abs(self):
here = os.path.dirname(os.path.abspath(__file__))
statinfo = statfiles(__file__)
self.assertIsInstance(statinfo, dict)
self.assertTrue(__file__ in statinfo)
@ -100,6 +99,7 @@ class Test_att_statinfo(unittest.TestCase):
def test_max_mtime(self):
pass
class Test_makefh(unittest.TestCase):
def test_makefh(self):