Skip to content

Commit

Permalink
Removed some Python 2 references in test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
heuer committed Oct 29, 2023
1 parent 473fe1a commit d3f660d
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 29 deletions.
7 changes: 2 additions & 5 deletions tests/test_issue65_colorful_datauris.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@
Test against issue #65.
<https://github.com/heuer/segno/issues/65>
"""
from __future__ import unicode_literals, absolute_import
import io
import base64
import pytest
import segno
try:
from urllib.parse import quote
except ImportError:
from urllib import quote
from urllib.parse import quote



def test_png_colorful():
Expand Down
9 changes: 0 additions & 9 deletions tests/test_issue82_svg_inline.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,9 @@
"""\
SVG embeddable into HTML tests.
"""
from __future__ import absolute_import, unicode_literals
import xml.etree.ElementTree as etree
import pytest
import segno
_PY2 = False
try:
unicode
_PY2 = True
except NameError:
pass

_CSS_CLASS = 'segno'
_PATH_CLASS = 'qrline'
Expand Down Expand Up @@ -48,8 +41,6 @@ def _parse_xml(s):
"""\
Parses XML and returns the root element.
"""
if _PY2:
s = s.encode('utf-8')
return etree.fromstring(s)


Expand Down
5 changes: 0 additions & 5 deletions tests/test_issue_105_epc_slash.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,9 @@
Requires pyzbar and additional libs (libzbar0).
"""
from __future__ import absolute_import, unicode_literals
import io
import pytest
from segno.helpers import make_epc_qr
try:
FileNotFoundError
except NameError: # Py2
FileNotFoundError = OSError
try:
from pyzbar.pyzbar import decode as zbardecode
except (ImportError, FileNotFoundError): # The latter may occur under Windows
Expand Down
5 changes: 0 additions & 5 deletions tests/test_issue_109_bytes.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,9 @@
Requires pyzbar and additional libs (libzbar0).
"""
from __future__ import absolute_import, unicode_literals
import io
import pytest
import segno
try:
FileNotFoundError
except NameError: # Py2
FileNotFoundError = OSError
try:
from pyzbar.pyzbar import decode as zbardecode
except (ImportError, FileNotFoundError): # The latter may occur under Windows
Expand Down
5 changes: 0 additions & 5 deletions tests/test_pam.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,10 @@
"""\
PAM related tests.
"""
from __future__ import unicode_literals, absolute_import
import re
import io
import pytest
import segno
try:
range = xrange # noqa
except NameError:
pass


def test_invalid_color():
Expand Down

0 comments on commit d3f660d

Please sign in to comment.