summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAarni Koskela <akx@iki.fi>2022-05-10 10:51:08 +0300
committerAarni Koskela <akx@iki.fi>2022-05-10 12:42:16 +0200
commit53a74f1c1567b28e6e23bb1ab48ca3a0f888d307 (patch)
treec27d3409e45fbd3317212bee798b57cfd3b54eaf /tests
parent128322c6b9ad23f4c1cd0b3996dd00fc48306750 (diff)
downloadbabel-53a74f1c1567b28e6e23bb1ab48ca3a0f888d307.tar.gz
Fix up some Python2-isms using pyupgrade
Diffstat (limited to 'tests')
-rw-r--r--tests/messages/test_catalog.py1
-rw-r--r--tests/messages/test_checkers.py1
-rw-r--r--tests/messages/test_extract.py1
-rw-r--r--tests/messages/test_frontend.py9
-rw-r--r--tests/messages/test_js_extract.py1
-rw-r--r--tests/messages/test_jslexer.py2
-rw-r--r--tests/messages/test_mofile.py1
-rw-r--r--tests/messages/test_plurals.py1
-rw-r--r--tests/messages/test_pofile.py1
-rw-r--r--tests/test_core.py1
-rw-r--r--tests/test_date_intervals.py3
-rw-r--r--tests/test_dates.py1
-rw-r--r--tests/test_day_periods.py1
-rw-r--r--tests/test_languages.py1
-rw-r--r--tests/test_lists.py1
-rw-r--r--tests/test_localedata.py1
-rw-r--r--tests/test_numbers.py1
-rw-r--r--tests/test_plural.py1
-rw-r--r--tests/test_smoke.py1
-rw-r--r--tests/test_support.py1
-rw-r--r--tests/test_util.py1
21 files changed, 4 insertions, 28 deletions
diff --git a/tests/messages/test_catalog.py b/tests/messages/test_catalog.py
index 830cabf..f320236 100644
--- a/tests/messages/test_catalog.py
+++ b/tests/messages/test_catalog.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team
# All rights reserved.
diff --git a/tests/messages/test_checkers.py b/tests/messages/test_checkers.py
index b709d4b..2ae5946 100644
--- a/tests/messages/test_checkers.py
+++ b/tests/messages/test_checkers.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team
# All rights reserved.
diff --git a/tests/messages/test_extract.py b/tests/messages/test_extract.py
index fb9599d..3ed71de 100644
--- a/tests/messages/test_extract.py
+++ b/tests/messages/test_extract.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team
# All rights reserved.
diff --git a/tests/messages/test_frontend.py b/tests/messages/test_frontend.py
index 4ed30ec..bacb0e2 100644
--- a/tests/messages/test_frontend.py
+++ b/tests/messages/test_frontend.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team
# All rights reserved.
@@ -1194,7 +1193,7 @@ compiling catalog %s to %s
'-o', po_file,
'-i', tmpl_file
])
- with open(po_file, "r") as infp:
+ with open(po_file) as infp:
catalog = read_po(infp)
assert len(catalog) == 3
@@ -1210,7 +1209,7 @@ compiling catalog %s to %s
'-o', po_file,
'-i', tmpl_file])
- with open(po_file, "r") as infp:
+ with open(po_file) as infp:
catalog = read_po(infp)
assert len(catalog) == 4 # Catalog was updated
@@ -1288,7 +1287,7 @@ compiling catalog %s to %s
'-o', po_file,
'-i', tmpl_file])
- with open(po_file, "r") as infp:
+ with open(po_file) as infp:
catalog = read_po(infp)
assert len(catalog) == 3
@@ -1305,7 +1304,7 @@ compiling catalog %s to %s
'-o', po_file,
'-i', tmpl_file])
- with open(po_file, "r") as infp:
+ with open(po_file) as infp:
catalog = read_po(infp)
assert len(catalog) == 4 # Catalog was updated
diff --git a/tests/messages/test_js_extract.py b/tests/messages/test_js_extract.py
index 73b16a9..72c5211 100644
--- a/tests/messages/test_js_extract.py
+++ b/tests/messages/test_js_extract.py
@@ -1,4 +1,3 @@
-# -- encoding: UTF-8 --
from io import BytesIO
import pytest
from babel.messages import extract
diff --git a/tests/messages/test_jslexer.py b/tests/messages/test_jslexer.py
index b70621f..35204ee 100644
--- a/tests/messages/test_jslexer.py
+++ b/tests/messages/test_jslexer.py
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
from babel.messages import jslexer
diff --git a/tests/messages/test_mofile.py b/tests/messages/test_mofile.py
index 93f3689..bf6ef5e 100644
--- a/tests/messages/test_mofile.py
+++ b/tests/messages/test_mofile.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team
# All rights reserved.
diff --git a/tests/messages/test_plurals.py b/tests/messages/test_plurals.py
index 0d20541..df17fd8 100644
--- a/tests/messages/test_plurals.py
+++ b/tests/messages/test_plurals.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team
# All rights reserved.
diff --git a/tests/messages/test_pofile.py b/tests/messages/test_pofile.py
index b154c09..632efe7 100644
--- a/tests/messages/test_pofile.py
+++ b/tests/messages/test_pofile.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team
# All rights reserved.
diff --git a/tests/test_core.py b/tests/test_core.py
index 53578f8..529a424 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team
# All rights reserved.
diff --git a/tests/test_date_intervals.py b/tests/test_date_intervals.py
index 4f42170..dc3ae34 100644
--- a/tests/test_date_intervals.py
+++ b/tests/test_date_intervals.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
import datetime
from babel import dates
diff --git a/tests/test_dates.py b/tests/test_dates.py
index 9367466..6a24ed4 100644
--- a/tests/test_dates.py
+++ b/tests/test_dates.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team
# All rights reserved.
diff --git a/tests/test_day_periods.py b/tests/test_day_periods.py
index 52cbc5e..414c0f6 100644
--- a/tests/test_day_periods.py
+++ b/tests/test_day_periods.py
@@ -1,4 +1,3 @@
-# -- encoding: UTF-8 --
from datetime import time
import babel.dates as dates
diff --git a/tests/test_languages.py b/tests/test_languages.py
index 32f0d67..41fcc9e 100644
--- a/tests/test_languages.py
+++ b/tests/test_languages.py
@@ -1,4 +1,3 @@
-# -- encoding: UTF-8 --
from babel.languages import get_official_languages, get_territory_language_info
diff --git a/tests/test_lists.py b/tests/test_lists.py
index e843a63..e51f18b 100644
--- a/tests/test_lists.py
+++ b/tests/test_lists.py
@@ -1,4 +1,3 @@
-# coding=utf-8
import pytest
from babel import lists
diff --git a/tests/test_localedata.py b/tests/test_localedata.py
index e93309b..8c4e40e 100644
--- a/tests/test_localedata.py
+++ b/tests/test_localedata.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team
# All rights reserved.
diff --git a/tests/test_numbers.py b/tests/test_numbers.py
index 3fab394..bac6c61 100644
--- a/tests/test_numbers.py
+++ b/tests/test_numbers.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team
# All rights reserved.
diff --git a/tests/test_plural.py b/tests/test_plural.py
index b0230c7..4210033 100644
--- a/tests/test_plural.py
+++ b/tests/test_plural.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team
# All rights reserved.
diff --git a/tests/test_smoke.py b/tests/test_smoke.py
index 052c1cb..aed676a 100644
--- a/tests/test_smoke.py
+++ b/tests/test_smoke.py
@@ -1,4 +1,3 @@
-# -- encoding: UTF-8 --
"""
These tests do not verify any results and should not be run when
looking at improving test coverage. They just verify that basic
diff --git a/tests/test_support.py b/tests/test_support.py
index 6e4c44b..a4fa326 100644
--- a/tests/test_support.py
+++ b/tests/test_support.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team
# All rights reserved.
diff --git a/tests/test_util.py b/tests/test_util.py
index 43076ad..e6a19d5 100644
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team
# All rights reserved.