Skip to content

Commit

Permalink
Drop artefact for python2 support
Browse files Browse the repository at this point in the history
Remove python2 compatible syntax in tests and remove a packaging option in `setup.cfg` (c.f. https://packaging.python.org/en/latest/guides/dropping-older-python-versions/)
  • Loading branch information
louis-jaris committed Oct 22, 2022
1 parent d1731dd commit 5842362
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
6 changes: 0 additions & 6 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
[bdist_wheel]
# This flag says that the code is written to work on both Python 2 and Python
# 3. If at all possible, it is good practice to do this. If you cannot, you
# will need to generate wheels for each Python version that you support.
python-tag=py3

[mypy]

# For details on each flag, please see the mypy documentation at:
Expand Down
8 changes: 2 additions & 6 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@
except ImportError:
pass

try:
from StringIO import StringIO # noqa
except ImportError:
# Python 3 Support
from io import StringIO
from io import StringIO

sys.path.append('src/python-json-logger')
from pythonjsonlogger import jsonlogger
Expand Down Expand Up @@ -78,7 +74,6 @@ def testAddStaticFields(self):
self.assertEqual(logJson["log_stream"], "kafka")
self.assertEqual(logJson["message"], msg)


def testFormatKeys(self):
supported_keys = [
'asctime',
Expand Down Expand Up @@ -258,6 +253,7 @@ def encode_complex(z):
msg = self.buffer.getvalue()
self.assertEqual(msg, "{\"message\": \" message\", \"special\": [3.0, 8.0]}\n")


if __name__ == '__main__':
if len(sys.argv[1:]) > 0:
if sys.argv[1] == 'xml':
Expand Down

0 comments on commit 5842362

Please sign in to comment.