Skip to content

Commit 634d12b

Browse files
committed
build: various python syntax fixes
1 parent 3ac8d63 commit 634d12b

4 files changed

Lines changed: 15 additions & 16 deletions

File tree

mflog/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ def add_override(logger_name_pattern, minimal_level_name):
392392
if minimal_level_name is None:
393393
try:
394394
# pylint: disable=unsupported-delete-operation
395-
del(Config.override_dict[logger_name_pattern])
395+
del (Config.override_dict[logger_name_pattern])
396396
except KeyError:
397397
pass
398398
else:

mflog/unittests.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111

1212
def reset_unittests():
1313
"""Reset unittests."""
14-
del(UNIT_TESTS_STDOUT[:])
15-
del(UNIT_TESTS_STDERR[:])
16-
del(UNIT_TESTS_JSON[:])
14+
del (UNIT_TESTS_STDOUT[:])
15+
del (UNIT_TESTS_STDERR[:])
16+
del (UNIT_TESTS_JSON[:])
1717
try:
18-
del(os.environ["MFLOG_EXTRA_CONTEXT_FUNC"])
18+
del (os.environ["MFLOG_EXTRA_CONTEXT_FUNC"])
1919
except Exception:
2020
pass
2121
try:
22-
del(os.environ["MFLOG_JSON_ONLY_KEYS"])
22+
del (os.environ["MFLOG_JSON_ONLY_KEYS"])
2323
except Exception:
2424
pass
2525
mflog.__unset_configuration()

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
with open("README.md") as f:
1111
long_description = f.read()
1212

13-
#Version "0.0.0" will be replaced by CI when releasing
13+
# Version "0.0.0" will be replaced by CI when releasing
1414
setup(
1515
author="Fabien MARTY",
1616
author_email="fabien.marty@gmail.com",

tests/test_basic.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from mflog import UNIT_TESTS_STDOUT, UNIT_TESTS_STDERR, UNIT_TESTS_JSON
1010
from mflog.unittests import reset_unittests, extra_context
1111
import logging
12-
import six
1312

1413

1514
def _test_stdxxx(stdxxx, level, msg, extra=None):
@@ -43,8 +42,8 @@ def test_basic_warning():
4342
x = get_logger()
4443
x.warning("foo")
4544
assert UNIT_TESTS_STDOUT == []
46-
#_test_stdxxx(UNIT_TESTS_STDERR, "WARNING", "foo")
47-
#_test_json("WARNING", "foo")
45+
# _test_stdxxx(UNIT_TESTS_STDERR, "WARNING", "foo")
46+
# _test_json("WARNING", "foo")
4847

4948

5049
def test_override_dict():
@@ -94,7 +93,7 @@ def test_logger_name():
9493
assert UNIT_TESTS_STDERR == []
9594
assert UNIT_TESTS_JSON == []
9695
# _test_stdxxx(UNIT_TESTS_STDOUT, "INFO", "test")
97-
#assert "foo.bar" in UNIT_TESTS_STDOUT[0]
96+
# assert "foo.bar" in UNIT_TESTS_STDOUT[0]
9897

9998

10099
def test_basic_critical():
@@ -139,12 +138,12 @@ def test_issue3():
139138
x.exception(e)
140139
assert UNIT_TESTS_STDOUT == []
141140
# if six.PY2:
142-
# _test_stdxxx(UNIT_TESTS_STDERR, "ERROR",
143-
# "integer division or modulo by zero")
144-
# tmp = _test_json("ERROR", "integer division or modulo by zero")
141+
# _test_stdxxx(UNIT_TESTS_STDERR, "ERROR",
142+
# "integer division or modulo by zero")
143+
# tmp = _test_json("ERROR", "integer division or modulo by zero")
145144
# else:
146-
# _test_stdxxx(UNIT_TESTS_STDERR, "ERROR", "division by zero")
147-
# tmp = _test_json("ERROR", "division by zero")
145+
# _test_stdxxx(UNIT_TESTS_STDERR, "ERROR", "division by zero")
146+
# tmp = _test_json("ERROR", "division by zero")
148147
# assert len(tmp['exception']) > 10
149148
# assert tmp['exception_type'] == 'ZeroDivisionError'
150149
# assert tmp['exception_file'] == __file__

0 commit comments

Comments
 (0)