Skip to content

Commit 308289f

Browse files
author
Hugo Osvaldo Barrera
committed
Remove python2 leftover code
1 parent eece9a6 commit 308289f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+253
-344
lines changed

docs/conf.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
import datetime
42
import os
53

@@ -12,8 +10,8 @@
1210
source_suffix = '.rst'
1311
master_doc = 'index'
1412

15-
project = u'vdirsyncer'
16-
copyright = (u'2014-{}, Markus Unterwaditzer & contributors'
13+
project = 'vdirsyncer'
14+
copyright = ('2014-{}, Markus Unterwaditzer & contributors'
1715
.format(datetime.date.today().strftime('%Y')))
1816

1917
release = setuptools_scm.get_version(root='..', relative_to=__file__)
@@ -44,18 +42,18 @@
4442

4543
latex_elements = {}
4644
latex_documents = [
47-
('index', 'vdirsyncer.tex', u'vdirsyncer Documentation',
48-
u'Markus Unterwaditzer', 'manual'),
45+
('index', 'vdirsyncer.tex', 'vdirsyncer Documentation',
46+
'Markus Unterwaditzer', 'manual'),
4947
]
5048

5149
man_pages = [
52-
('index', 'vdirsyncer', u'vdirsyncer Documentation',
53-
[u'Markus Unterwaditzer'], 1)
50+
('index', 'vdirsyncer', 'vdirsyncer Documentation',
51+
['Markus Unterwaditzer'], 1)
5452
]
5553

5654
texinfo_documents = [
57-
('index', 'vdirsyncer', u'vdirsyncer Documentation',
58-
u'Markus Unterwaditzer', 'vdirsyncer',
55+
('index', 'vdirsyncer', 'vdirsyncer Documentation',
56+
'Markus Unterwaditzer', 'vdirsyncer',
5957
'Synchronize calendars and contacts.', 'Miscellaneous'),
6058
]
6159

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
'''
32
Vdirsyncer synchronizes calendars and contacts.
43

tests/__init__.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
'''
32
Test suite for vdirsyncer.
43
'''
@@ -21,7 +20,7 @@ def assert_item_equals(a, b):
2120
assert normalize_item(a) == normalize_item(b)
2221

2322

24-
VCARD_TEMPLATE = u'''BEGIN:VCARD
23+
VCARD_TEMPLATE = '''BEGIN:VCARD
2524
VERSION:3.0
2625
FN:Cyrus Daboo
2726
N:Daboo;Cyrus;;;
@@ -37,7 +36,7 @@ def assert_item_equals(a, b):
3736
UID:{uid}
3837
END:VCARD'''
3938

40-
TASK_TEMPLATE = u'''BEGIN:VCALENDAR
39+
TASK_TEMPLATE = '''BEGIN:VCALENDAR
4140
VERSION:2.0
4241
PRODID:-//dmfs.org//mimedir.icalendar//EN
4342
BEGIN:VTODO
@@ -52,7 +51,7 @@ def assert_item_equals(a, b):
5251
END:VCALENDAR'''
5352

5453

55-
BARE_EVENT_TEMPLATE = u'''BEGIN:VEVENT
54+
BARE_EVENT_TEMPLATE = '''BEGIN:VEVENT
5655
DTSTART:19970714T170000Z
5756
DTEND:19970715T035959Z
5857
SUMMARY:Bastille Day Party
@@ -61,10 +60,10 @@ def assert_item_equals(a, b):
6160
END:VEVENT'''
6261

6362

64-
EVENT_TEMPLATE = u'''BEGIN:VCALENDAR
63+
EVENT_TEMPLATE = '''BEGIN:VCALENDAR
6564
VERSION:2.0
6665
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
67-
''' + BARE_EVENT_TEMPLATE + u'''
66+
''' + BARE_EVENT_TEMPLATE + '''
6867
END:VCALENDAR'''
6968

7069
EVENT_WITH_TIMEZONE_TEMPLATE = '''BEGIN:VCALENDAR
@@ -90,7 +89,7 @@ def assert_item_equals(a, b):
9089
END:VCALENDAR'''
9190

9291

93-
SIMPLE_TEMPLATE = u'''BEGIN:FOO
92+
SIMPLE_TEMPLATE = '''BEGIN:FOO
9493
UID:{uid}
9594
X-SOMETHING:{r}
9695
HAHA:YES

tests/conftest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
'''
32
General-purpose fixtures for vdirsyncer's testsuite.
43
'''

tests/storage/__init__.py

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
import random
42
import uuid
53

@@ -31,7 +29,7 @@ def format_item(item_template, uid=None):
3129
return Item(item_template.format(r=r, uid=uid or r))
3230

3331

34-
class StorageTests(object):
32+
class StorageTests:
3533
storage_class = None
3634
supports_collections = True
3735
supports_metadata = True
@@ -173,10 +171,10 @@ def test_update_others_stay_the_same(self, s, get_item):
173171
_, etag = s.get(href)
174172
info[href] = etag
175173

176-
assert dict(
177-
(href, etag) for href, item, etag
174+
assert {
175+
href: etag for href, item, etag
178176
in s.get_multi(href for href, etag in info.items())
179-
) == info
177+
} == info
180178

181179
def test_repr(self, s, get_storage_args):
182180
assert self.storage_class.__name__ in repr(s)
@@ -191,10 +189,10 @@ def test_discover(self, requires_collections, get_storage_args, get_item):
191189
s.upload(get_item())
192190
collections.add(s.collection)
193191

194-
actual = set(
192+
actual = {
195193
c['collection'] for c in
196194
self.storage_class.discover(**get_storage_args(collection=None))
197-
)
195+
}
198196

199197
assert actual >= collections
200198

@@ -212,7 +210,7 @@ def test_create_collection(self, requires_collections, get_storage_args,
212210
)
213211

214212
href = s.upload(get_item())[0]
215-
assert href in set(href for href, etag in s.list())
213+
assert href in {href for href, etag in s.list()}
216214

217215
def test_discover_collection_arg(self, requires_collections,
218216
get_storage_args):
@@ -255,7 +253,7 @@ def test_specialchars(self, monkeypatch, requires_collections,
255253

256254
monkeypatch.setattr('vdirsyncer.utils.generate_href', lambda x: x)
257255

258-
uid = u'test @ foo ät bar град сатану'
256+
uid = 'test @ foo ät bar град сатану'
259257
collection = 'test @ foo ät bar'
260258

261259
s = self.storage_class(**get_storage_args(collection=collection))
@@ -286,12 +284,12 @@ def test_metadata(self, requires_metadata, s):
286284
try:
287285
s.set_meta('color', None)
288286
assert not s.get_meta('color')
289-
s.set_meta('color', u'#ff0000')
290-
assert s.get_meta('color') == u'#ff0000'
287+
s.set_meta('color', '#ff0000')
288+
assert s.get_meta('color') == '#ff0000'
291289
except exceptions.UnsupportedMetadataError:
292290
pass
293291

294-
for x in (u'hello world', u'hello wörld'):
292+
for x in ('hello world', 'hello wörld'):
295293
s.set_meta('displayname', x)
296294
rv = s.get_meta('displayname')
297295
assert rv == x
@@ -315,7 +313,7 @@ def test_recurring_events(self, s, item_type):
315313
pytest.skip('This storage instance doesn\'t support iCalendar.')
316314

317315
uid = str(uuid.uuid4())
318-
item = Item(textwrap.dedent(u'''
316+
item = Item(textwrap.dedent('''
319317
BEGIN:VCALENDAR
320318
VERSION:2.0
321319
BEGIN:VEVENT

tests/storage/conftest.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
import pytest
42

53
import uuid

tests/storage/dav/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
import uuid
42

53
import os
@@ -27,7 +25,7 @@ class DAVStorageTests(ServerMixin, StorageTests):
2725
@pytest.mark.skipif(dav_server == 'radicale',
2826
reason='Radicale is very tolerant.')
2927
def test_dav_broken_item(self, s):
30-
item = Item(u'HAHA:YES')
28+
item = Item('HAHA:YES')
3129
with pytest.raises((exceptions.Error, requests.exceptions.HTTPError)):
3230
s.upload(item)
3331
assert not list(s.list())
@@ -50,7 +48,7 @@ def test_dav_unicode_href(self, s, get_item, monkeypatch):
5048

5149
monkeypatch.setattr(s, '_get_href',
5250
lambda item: item.ident + s.fileext)
53-
item = get_item(uid=u'град сатану' + str(uuid.uuid4()))
51+
item = get_item(uid='град сатану' + str(uuid.uuid4()))
5452
href, etag = s.upload(item)
5553
item2, etag2 = s.get(href)
5654
assert_item_equals(item, item2)

tests/storage/dav/test_caldav.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
import datetime
42
from textwrap import dedent
53

@@ -64,7 +62,7 @@ def test_timerange_correctness(self, get_storage_args):
6462
s = self.storage_class(start_date=start_date, end_date=end_date,
6563
**get_storage_args())
6664

67-
too_old_item = format_item(dedent(u'''
65+
too_old_item = format_item(dedent('''
6866
BEGIN:VCALENDAR
6967
VERSION:2.0
7068
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
@@ -78,7 +76,7 @@ def test_timerange_correctness(self, get_storage_args):
7876
END:VCALENDAR
7977
''').strip())
8078

81-
too_new_item = format_item(dedent(u'''
79+
too_new_item = format_item(dedent('''
8280
BEGIN:VCALENDAR
8381
VERSION:2.0
8482
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
@@ -92,7 +90,7 @@ def test_timerange_correctness(self, get_storage_args):
9290
END:VCALENDAR
9391
''').strip())
9492

95-
good_item = format_item(dedent(u'''
93+
good_item = format_item(dedent('''
9694
BEGIN:VCALENDAR
9795
VERSION:2.0
9896
PRODID:-//hacksw/handcal//NONSGML v1.0//EN

tests/storage/dav/test_carddav.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
import pytest
42

53
from vdirsyncer.storage.dav import CardDAVStorage

tests/storage/etesync/test_main.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
import shutil
42
import os
53
import sys

0 commit comments

Comments
 (0)