Permalink
Browse files

Fixes for pyflakes errors

Fix pyflakes complaints and make pyflakes failure fail the tox build

This fixes the pyflakes portion of #27
  • Loading branch information...
abadger committed Oct 19, 2017
1 parent 374f683 commit 7b38357a9647958813edc93f3c9fb1f3e18516f9
View
@@ -23,4 +23,4 @@
"""))
os.remove(fname)
print "{0:.3f} sec for {1:n} loops".format(t, loops)
print("{0:.3f} sec for {1:n} loops".format(t, loops))
View
@@ -19,4 +19,4 @@
"""))
os.remove(fname)
print "{0:.3f} sec for {1:n} loops".format(t, loops)
print("{0:.3f} sec for {1:n} loops".format(t, loops))
View
@@ -75,7 +75,7 @@ def test_init_dict(self):
def test_init_bad(self):
with self.assertRaises(ValueError):
ct = ConversionTable(['oops'])
ConversionTable(['oops'])
def test_copy(self):
ct = ConversionTable([("pants", conv_val, conv_item),
View
@@ -9,7 +9,7 @@
import re
from twiggy import filters, message, levels
from twiggy import filters, levels
from . import make_mesg
@@ -59,7 +59,7 @@ def test_callable(self):
def test_bad_arg(self):
with self.assertRaises(ValueError):
f = filters.msg_filter(42)
filters.msg_filter(42)
def test_list(self):
re1 = "^Hello.*$"
@@ -1,7 +1,6 @@
from __future__ import print_function
import sys
import time
if sys.version_info >= (2, 7):
import unittest
else:
View
@@ -43,7 +43,7 @@ def test_options(self):
def test_bad_options(self):
with self.assertRaises(ValueError):
log = self.log.options(boom=True)
self.log.options(boom=True)
def test_trace(self):
log = self.log.trace('error')
@@ -196,7 +196,7 @@ def tearDown(self):
def test_struct_dict(self):
d={42:42}
log = self.log.struct_dict(d)
self.log.struct_dict(d)
assert len(self.messages) == 1
m = self.messages.pop()
self.assertDictContainsSubset(d, m.fields)
@@ -208,7 +208,7 @@ def test_struct_dict(self):
# in test_clone, but that's starting to get redundant
def test_fields(self):
log = self.log.struct(x=42)
self.log.struct(x=42)
assert len(self.messages) == 1
m = self.messages.pop()
self.assertDictContainsSubset({'x':42}, m.fields)
@@ -1,4 +1,3 @@
import os
import sys
from unittest import TestCase
View
@@ -166,7 +166,7 @@ def test_dollar_style_bad(self):
opts['style'] = 'dollar'
with self.assertRaises(ValueError):
m = Message(twiggy.levels.DEBUG,
Message(twiggy.levels.DEBUG,
"Hello $who",
{},
opts,
@@ -207,7 +207,7 @@ def test_percent_style_both(self):
opts['style'] = 'percent'
with self.assertRaises(ValueError):
m = Message(twiggy.levels.DEBUG,
Message(twiggy.levels.DEBUG,
"Hello %s %(who)s",
{},
opts,
@@ -262,7 +262,7 @@ def test_bad_trace(self):
opts['trace'] = 'kaboom'
with self.assertRaises(ValueError):
m = Message(twiggy.levels.DEBUG,
Message(twiggy.levels.DEBUG,
"Hello {0} {who}",
{'shirt': lambda: 42, 'name': 'jose'},
opts,
View
@@ -35,10 +35,10 @@ commands =
basepython = python3.6
commands =
pip install pyflakes
sh -c "pyflakes twiggy/ tests/ || :"
pyflakes twiggy/ tests/
[testenv:py2pyflakes]
basepython = python2.7
commands =
pip install pyflakes
sh -c "pyflakes twiggy/ tests/ || :"
pyflakes twiggy/ tests/
View
@@ -1,17 +1,14 @@
from __future__ import print_function
import sys
import time
import traceback
import warnings
from functools import wraps
from six import iteritems
import twiggy as _twiggy
from . import formats
from . import levels
from . import outputs
from .lib import iso8601time
from .message import Message
View
@@ -25,7 +25,7 @@
from .formats import LineFormat
from .outputs import Output
from . import levels, log
from .levels import *
from .levels import DEBUG, INFO, WARNING, ERROR, CRITICAL, NOTICE, DISABLED
def basicConfig(**kwargs):
raise RuntimeError("Twiggy doesn't support logging's basicConfig")

0 comments on commit 7b38357

Please sign in to comment.