Skip to content

Commit

Permalink
Get rid of places checking for Python major version
Browse files Browse the repository at this point in the history
  • Loading branch information
akx authored and gentooboontoo committed Nov 22, 2023
1 parent 2cacf64 commit 527dc0d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 37 deletions.
32 changes: 1 addition & 31 deletions pygal/test/test_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import io
import os
import sys
import uuid

import pytest
Expand Down Expand Up @@ -326,36 +325,7 @@ def test_unicode_labels_decode(Chart):
chart.render_pyquery()


def test_unicode_labels_python2(Chart):
"""Test unicode labels in python 2"""
if sys.version_info[0] == 3:
return
chart = Chart()
chart.add(
'Série1', [{
'value': 1,
'xlink': 'http://1/',
'label': eval("u'°ijæð©&×&<—×€¿_…'")
}, {
'value': 2,
'xlink': {
'href': 'http://6.example.com/'
},
'label': eval("u'æ°€≠|€æ°€əæ'")
}, {
'value': 3,
'label': eval("'unicode <3'")
}]
)
if not chart._dual:
chart.x_labels = eval("[u'&œ', u'¿?', u'††††††††', 'unicode <3']")
chart.render_pyquery()


def test_unicode_labels_python3(Chart):
"""Test unicode labels in python 3"""
if sys.version_info[0] == 2:
return
def test_unicode_labels(Chart):
chart = Chart()
chart.add(
'Série1', [{
Expand Down
7 changes: 1 addition & 6 deletions pygal/test/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
# along with pygal. If not, see <http://www.gnu.org/licenses/>.
"""Utility functions tests"""

import sys

from pytest import raises

Expand Down Expand Up @@ -172,8 +171,4 @@ def test_mergextend():
assert mergextend(['a', Ellipsis, 'b'],
['c', 'd']) == ['a', 'c', 'd', 'b']

if sys.version_info[0] >= 3:
# For @#! sake it's 2016 now
assert eval("mergextend(['a', ..., 'b'], ['c', 'd'])") == [
'a', 'c', 'd', 'b'
]
assert mergextend(['a', ..., 'b'], ['c', 'd']) == ['a', 'c', 'd', 'b']

0 comments on commit 527dc0d

Please sign in to comment.