From 7573747cda7536c7d15595dc1d03c513b387743c Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 14 May 2019 19:42:44 -0300 Subject: [PATCH] Normalize all source encoding declarations --- src/_pytest/skipping.py | 2 +- testing/acceptance_test.py | 2 +- testing/code/test_excinfo.py | 2 +- testing/code/test_source.py | 2 +- testing/io/test_saferepr.py | 2 +- testing/logging/test_fixture.py | 2 +- testing/logging/test_reporting.py | 4 ++-- testing/python/collect.py | 6 +++--- testing/python/fixtures.py | 2 +- testing/python/metafunc.py | 2 +- testing/python/show_fixtures_per_test.py | 2 +- testing/test_assertion.py | 4 ++-- testing/test_assertrewrite.py | 8 ++++---- testing/test_capture.py | 4 ++-- testing/test_doctest.py | 2 +- testing/test_junitxml.py | 2 +- testing/test_pluginmanager.py | 4 ++-- testing/test_pytester.py | 2 +- testing/test_runner.py | 4 ++-- testing/test_skipping.py | 2 +- testing/test_warnings.py | 8 ++++---- 21 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/_pytest/skipping.py b/src/_pytest/skipping.py index 1d70fb153..94a43de49 100644 --- a/src/_pytest/skipping.py +++ b/src/_pytest/skipping.py @@ -1,4 +1,4 @@ -# coding=utf8 +# coding: utf-8 """ support for skip/xfail functions and markers. """ from __future__ import absolute_import from __future__ import division diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index b0c682900..a6bf93459 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# coding: utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/testing/code/test_excinfo.py b/testing/code/test_excinfo.py index a76797301..09e96a45f 100644 --- a/testing/code/test_excinfo.py +++ b/testing/code/test_excinfo.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# coding: utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/testing/code/test_source.py b/testing/code/test_source.py index 0a2a98c02..7a9e8b79f 100644 --- a/testing/code/test_source.py +++ b/testing/code/test_source.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# coding: utf-8 # flake8: noqa # disable flake check on this file because some constructs are strange # or redundant on purpose and can't be disable on a line-by-line basis diff --git a/testing/io/test_saferepr.py b/testing/io/test_saferepr.py index 901203088..abee94999 100644 --- a/testing/io/test_saferepr.py +++ b/testing/io/test_saferepr.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# coding: utf-8 from _pytest._io.saferepr import saferepr diff --git a/testing/logging/test_fixture.py b/testing/logging/test_fixture.py index ff772e7ec..89065b086 100644 --- a/testing/logging/test_fixture.py +++ b/testing/logging/test_fixture.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# coding: utf-8 import logging import pytest diff --git a/testing/logging/test_reporting.py b/testing/logging/test_reporting.py index 77cf71b43..ce6892492 100644 --- a/testing/logging/test_reporting.py +++ b/testing/logging/test_reporting.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# coding: utf-8 import os import re from io import open @@ -842,7 +842,7 @@ def test_log_file_unicode(testdir): ) testdir.makepyfile( """ - # -*- coding: utf-8 -*- + # coding: utf-8 from __future__ import unicode_literals import logging diff --git a/testing/python/collect.py b/testing/python/collect.py index 9430bcaa1..3b5e9dd42 100644 --- a/testing/python/collect.py +++ b/testing/python/collect.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# coding: utf-8 import os import sys import textwrap @@ -119,7 +119,7 @@ class TestModule(object): """ testdir.makepyfile( u""" - # -*- coding: utf-8 -*- + # coding: utf-8 raise ImportError(u'Something bad happened ☺') """ ) @@ -1244,7 +1244,7 @@ def test_syntax_error_with_non_ascii_chars(testdir): """ testdir.makepyfile( u""" - # -*- coding: UTF-8 -*- + # coding: utf-8 ☃ """ diff --git a/testing/python/fixtures.py b/testing/python/fixtures.py index 18ede4006..2f64b1be2 100644 --- a/testing/python/fixtures.py +++ b/testing/python/fixtures.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# coding: utf-8 import sys import textwrap diff --git a/testing/python/metafunc.py b/testing/python/metafunc.py index 29f18da36..2a84a7a57 100644 --- a/testing/python/metafunc.py +++ b/testing/python/metafunc.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# coding: utf-8 import re import sys import textwrap diff --git a/testing/python/show_fixtures_per_test.py b/testing/python/show_fixtures_per_test.py index e14344d4e..f677b3067 100644 --- a/testing/python/show_fixtures_per_test.py +++ b/testing/python/show_fixtures_per_test.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# coding: utf-8 def test_no_items_should_not_show_output(testdir): diff --git a/testing/test_assertion.py b/testing/test_assertion.py index 8a59b7e8d..7d92b1bac 100644 --- a/testing/test_assertion.py +++ b/testing/test_assertion.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# coding: utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function @@ -1297,7 +1297,7 @@ def test_assert_indirect_tuple_no_warning(testdir): def test_assert_with_unicode(monkeypatch, testdir): testdir.makepyfile( u""" - # -*- coding: utf-8 -*- + # coding: utf-8 def test_unicode(): assert u'유니코드' == u'Unicode' """ diff --git a/testing/test_assertrewrite.py b/testing/test_assertrewrite.py index 87dada213..5b527ca22 100644 --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# coding: utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function @@ -960,7 +960,7 @@ class TestAssertionRewriteHookDetails(object): def test_detect_coding_cookie(self, testdir): testdir.makepyfile( test_cookie=""" - # -*- coding: utf-8 -*- + # coding: utf-8 u"St\xc3\xa4d" def test_rewritten(): assert "@py_builtins" in globals()""" @@ -971,7 +971,7 @@ class TestAssertionRewriteHookDetails(object): def test_detect_coding_cookie_second_line(self, testdir): testdir.makepyfile( test_cookie=""" - # -*- coding: utf-8 -*- + # coding: utf-8 u"St\xc3\xa4d" def test_rewritten(): assert "@py_builtins" in globals()""" @@ -982,7 +982,7 @@ class TestAssertionRewriteHookDetails(object): def test_detect_coding_cookie_crlf(self, testdir): testdir.makepyfile( test_cookie=""" - # -*- coding: utf-8 -*- + # coding: utf-8 u"St\xc3\xa4d" def test_rewritten(): assert "@py_builtins" in globals()""" diff --git a/testing/test_capture.py b/testing/test_capture.py index 0dc2c42d8..42bb4b8aa 100644 --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# coding: utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function @@ -106,7 +106,7 @@ def test_capturing_unicode(testdir, method): obj = "u'\u00f6y'" testdir.makepyfile( """ - # coding=utf-8 + # coding: utf-8 # taken from issue 227 from nosetests def test_unicode(): import sys diff --git a/testing/test_doctest.py b/testing/test_doctest.py index db6c4c2d3..164fdc423 100644 --- a/testing/test_doctest.py +++ b/testing/test_doctest.py @@ -658,7 +658,7 @@ class TestDoctests(object): """ p = testdir.makepyfile( test_unicode_doctest_module=""" - # -*- encoding: utf-8 -*- + # encoding: utf-8 from __future__ import unicode_literals def fix_bad_unicode(text): diff --git a/testing/test_junitxml.py b/testing/test_junitxml.py index cca0143a2..41b27e275 100644 --- a/testing/test_junitxml.py +++ b/testing/test_junitxml.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# coding: utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/testing/test_pluginmanager.py b/testing/test_pluginmanager.py index 12990c867..423a20c29 100644 --- a/testing/test_pluginmanager.py +++ b/testing/test_pluginmanager.py @@ -1,4 +1,4 @@ -# encoding: UTF-8 +# encoding: utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function @@ -155,7 +155,7 @@ def test_importplugin_error_message(testdir, pytestpm): testdir.syspathinsert(testdir.tmpdir) testdir.makepyfile( qwe=""" - # encoding: UTF-8 + # encoding: utf-8 def test_traceback(): raise ImportError(u'Not possible to import: ☺') test_traceback() diff --git a/testing/test_pytester.py b/testing/test_pytester.py index b76d413b7..bf6e5d97e 100644 --- a/testing/test_pytester.py +++ b/testing/test_pytester.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# coding: utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/testing/test_runner.py b/testing/test_runner.py index c52d2ea7c..7ab63b346 100644 --- a/testing/test_runner.py +++ b/testing/test_runner.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# coding: utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function @@ -793,7 +793,7 @@ def test_pytest_cmdline_main(testdir): def test_unicode_in_longrepr(testdir): testdir.makeconftest( """ - # -*- coding: utf-8 -*- + # coding: utf-8 import pytest @pytest.hookimpl(hookwrapper=True) def pytest_runtest_makereport(): diff --git a/testing/test_skipping.py b/testing/test_skipping.py index fb0822f8f..8df726bc8 100644 --- a/testing/test_skipping.py +++ b/testing/test_skipping.py @@ -1,4 +1,4 @@ -# coding=utf8 +# coding: utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/testing/test_warnings.py b/testing/test_warnings.py index 0daa466b7..ce157cbed 100644 --- a/testing/test_warnings.py +++ b/testing/test_warnings.py @@ -1,4 +1,4 @@ -# -*- coding: utf8 -*- +# coding: utf-8 from __future__ import unicode_literals import sys @@ -133,7 +133,7 @@ def test_ignore(testdir, pyfile_with_warnings, method): def test_unicode(testdir, pyfile_with_warnings): testdir.makepyfile( """ - # -*- coding: utf8 -*- + # coding: utf-8 import warnings import pytest @@ -168,7 +168,7 @@ def test_py2_unicode(testdir, pyfile_with_warnings): pytest.xfail("fails with unicode error on PyPy2 5.9 and Windows (#2905)") testdir.makepyfile( """ - # -*- coding: utf8 -*- + # coding: utf-8 import warnings import pytest @@ -577,7 +577,7 @@ def test_infinite_loop_warning_against_unicode_usage_py2(testdir): """ testdir.makepyfile( """ - # -*- coding: utf8 -*- + # coding: utf-8 from __future__ import unicode_literals import warnings import pytest