diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9c80e42e1..865b7979b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,6 +17,7 @@ repos: hooks: - id: trailing-whitespace - id: end-of-file-fixer + - id: fix-encoding-pragma - id: check-yaml - id: debug-statements exclude: _pytest/debugging.py diff --git a/bench/bench.py b/bench/bench.py index 31cc7ac13..468ef5219 100644 --- a/bench/bench.py +++ b/bench/bench.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import sys if __name__ == "__main__": diff --git a/bench/bench_argcomplete.py b/bench/bench_argcomplete.py index 335733df7..297637bad 100644 --- a/bench/bench_argcomplete.py +++ b/bench/bench_argcomplete.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # 10000 iterations, just for relative comparison # 2.7.5 3.3.2 # FilesCompleter 75.1109 69.2116 diff --git a/bench/empty.py b/bench/empty.py index 4e7371b6f..bfda88235 100644 --- a/bench/empty.py +++ b/bench/empty.py @@ -1,2 +1,3 @@ +# -*- coding: utf-8 -*- for i in range(1000): exec("def test_func_%d(): pass" % i) diff --git a/bench/manyparam.py b/bench/manyparam.py index 1226c73bd..c47e25f51 100644 --- a/bench/manyparam.py +++ b/bench/manyparam.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pytest diff --git a/bench/skip.py b/bench/skip.py index 2fc8240e5..29e03e54f 100644 --- a/bench/skip.py +++ b/bench/skip.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from six.moves import range import pytest diff --git a/doc/en/_themes/flask_theme_support.py b/doc/en/_themes/flask_theme_support.py index b107f2c89..c5dcdbe27 100644 --- a/doc/en/_themes/flask_theme_support.py +++ b/doc/en/_themes/flask_theme_support.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # flasky extensions. flasky pygments style based on tango style from pygments.style import Style from pygments.token import Comment diff --git a/doc/en/conftest.py b/doc/en/conftest.py index 1a62e1b5d..b51aae5b6 100644 --- a/doc/en/conftest.py +++ b/doc/en/conftest.py @@ -1 +1,2 @@ +# -*- coding: utf-8 -*- collect_ignore = ["conf.py"] diff --git a/doc/en/example/assertion/failure_demo.py b/doc/en/example/assertion/failure_demo.py index 5d36fa659..ba910ef6a 100644 --- a/doc/en/example/assertion/failure_demo.py +++ b/doc/en/example/assertion/failure_demo.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import _pytest._code import pytest from pytest import raises diff --git a/doc/en/example/assertion/global_testmodule_config/conftest.py b/doc/en/example/assertion/global_testmodule_config/conftest.py index da89047fe..8e04ac2ac 100644 --- a/doc/en/example/assertion/global_testmodule_config/conftest.py +++ b/doc/en/example/assertion/global_testmodule_config/conftest.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import py import pytest diff --git a/doc/en/example/assertion/global_testmodule_config/test_hello_world.py b/doc/en/example/assertion/global_testmodule_config/test_hello_world.py index a31a601a1..bfccc94f7 100644 --- a/doc/en/example/assertion/global_testmodule_config/test_hello_world.py +++ b/doc/en/example/assertion/global_testmodule_config/test_hello_world.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- hello = "world" diff --git a/doc/en/example/assertion/test_failures.py b/doc/en/example/assertion/test_failures.py index 30ebc72dc..60b5e2131 100644 --- a/doc/en/example/assertion/test_failures.py +++ b/doc/en/example/assertion/test_failures.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import py failure_demo = py.path.local(__file__).dirpath("failure_demo.py") diff --git a/doc/en/example/assertion/test_setup_flow_example.py b/doc/en/example/assertion/test_setup_flow_example.py index eb339f474..f49d6d8ed 100644 --- a/doc/en/example/assertion/test_setup_flow_example.py +++ b/doc/en/example/assertion/test_setup_flow_example.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- def setup_module(module): module.TestStateFullThing.classcount = 0 diff --git a/doc/en/example/conftest.py b/doc/en/example/conftest.py index f905738c4..1f5a961ad 100644 --- a/doc/en/example/conftest.py +++ b/doc/en/example/conftest.py @@ -1 +1,2 @@ +# -*- coding: utf-8 -*- collect_ignore = ["nonpython"] diff --git a/doc/en/example/costlysetup/conftest.py b/doc/en/example/costlysetup/conftest.py index 57b08b5fa..b90c77473 100644 --- a/doc/en/example/costlysetup/conftest.py +++ b/doc/en/example/costlysetup/conftest.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pytest diff --git a/doc/en/example/costlysetup/sub_a/__init__.py b/doc/en/example/costlysetup/sub_a/__init__.py index 792d60054..ec51c5a2b 100644 --- a/doc/en/example/costlysetup/sub_a/__init__.py +++ b/doc/en/example/costlysetup/sub_a/__init__.py @@ -1 +1,2 @@ +# -*- coding: utf-8 -*- # diff --git a/doc/en/example/costlysetup/sub_a/test_quick.py b/doc/en/example/costlysetup/sub_a/test_quick.py index 38dda2660..4f7b9f1ac 100644 --- a/doc/en/example/costlysetup/sub_a/test_quick.py +++ b/doc/en/example/costlysetup/sub_a/test_quick.py @@ -1,2 +1,3 @@ +# -*- coding: utf-8 -*- def test_quick(setup): pass diff --git a/doc/en/example/costlysetup/sub_b/__init__.py b/doc/en/example/costlysetup/sub_b/__init__.py index 792d60054..ec51c5a2b 100644 --- a/doc/en/example/costlysetup/sub_b/__init__.py +++ b/doc/en/example/costlysetup/sub_b/__init__.py @@ -1 +1,2 @@ +# -*- coding: utf-8 -*- # diff --git a/doc/en/example/costlysetup/sub_b/test_two.py b/doc/en/example/costlysetup/sub_b/test_two.py index b1653aaab..4e08bc2b6 100644 --- a/doc/en/example/costlysetup/sub_b/test_two.py +++ b/doc/en/example/costlysetup/sub_b/test_two.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- def test_something(setup): assert setup.timecostly == 1 diff --git a/doc/en/example/multipython.py b/doc/en/example/multipython.py index 4151c50a0..dc722aac9 100644 --- a/doc/en/example/multipython.py +++ b/doc/en/example/multipython.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ module containing a parametrized tests testing cross-python serialization via the pickle module. diff --git a/doc/en/example/nonpython/conftest.py b/doc/en/example/nonpython/conftest.py index 7c23025af..306aa2503 100644 --- a/doc/en/example/nonpython/conftest.py +++ b/doc/en/example/nonpython/conftest.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # content of conftest.py import pytest diff --git a/doc/en/example/py2py3/conftest.py b/doc/en/example/py2py3/conftest.py index 844510a25..a6b9af7a8 100644 --- a/doc/en/example/py2py3/conftest.py +++ b/doc/en/example/py2py3/conftest.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import sys import pytest diff --git a/doc/en/example/py2py3/test_py3.py b/doc/en/example/py2py3/test_py3.py index d95702a53..30151f914 100644 --- a/doc/en/example/py2py3/test_py3.py +++ b/doc/en/example/py2py3/test_py3.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- def test_exception_syntax(): try: 0 / 0 diff --git a/doc/en/example/pythoncollection.py b/doc/en/example/pythoncollection.py index b134d809d..bbc3fe868 100644 --- a/doc/en/example/pythoncollection.py +++ b/doc/en/example/pythoncollection.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # run this with $ pytest --collect-only test_collectonly.py # diff --git a/doc/en/example/xfail_demo.py b/doc/en/example/xfail_demo.py index 01e6da1ad..88384a156 100644 --- a/doc/en/example/xfail_demo.py +++ b/doc/en/example/xfail_demo.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pytest xfail = pytest.mark.xfail diff --git a/extra/get_issues.py b/extra/get_issues.py index 9407aeded..598a1af40 100644 --- a/extra/get_issues.py +++ b/extra/get_issues.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import json import py diff --git a/extra/setup-py.test/setup.py b/extra/setup-py.test/setup.py index d0560ce1f..cfe18c28f 100644 --- a/extra/setup-py.test/setup.py +++ b/extra/setup-py.test/setup.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import sys from distutils.core import setup diff --git a/scripts/release.py b/scripts/release.py index 5009df359..32178fcf6 100644 --- a/scripts/release.py +++ b/scripts/release.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ Invoke development tasks. """ diff --git a/setup.py b/setup.py index 0fb5a58a2..c16504411 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from setuptools import setup # TODO: if py gets upgrade to >=1.6, diff --git a/src/_pytest/__init__.py b/src/_pytest/__init__.py index 46c7827ed..17cc20b61 100644 --- a/src/_pytest/__init__.py +++ b/src/_pytest/__init__.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- __all__ = ["__version__"] try: diff --git a/src/_pytest/_argcomplete.py b/src/_pytest/_argcomplete.py index 455c3a7be..c6cf1d8fd 100644 --- a/src/_pytest/_argcomplete.py +++ b/src/_pytest/_argcomplete.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """allow bash-completion for argparse with argcomplete if installed needs argcomplete>=0.5.6 for python 3.2/3.3 (older versions fail to find the magic string, so _ARGCOMPLETE env. var is never set, and diff --git a/src/_pytest/_code/__init__.py b/src/_pytest/_code/__init__.py index fe755a399..1394b2b10 100644 --- a/src/_pytest/_code/__init__.py +++ b/src/_pytest/_code/__init__.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ python inspection/code generation API """ from __future__ import absolute_import from __future__ import division diff --git a/src/_pytest/_code/_py2traceback.py b/src/_pytest/_code/_py2traceback.py index 8a8b7bc00..faacc0216 100644 --- a/src/_pytest/_code/_py2traceback.py +++ b/src/_pytest/_code/_py2traceback.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # copied from python-2.7.3's traceback.py # CHANGES: # - some_str is replaced, trying to create unicode strings diff --git a/src/_pytest/_code/code.py b/src/_pytest/_code/code.py index a0b3c78ce..5f8110428 100644 --- a/src/_pytest/_code/code.py +++ b/src/_pytest/_code/code.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/src/_pytest/_code/source.py b/src/_pytest/_code/source.py index 39701a39b..c8a4b6adf 100644 --- a/src/_pytest/_code/source.py +++ b/src/_pytest/_code/source.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/src/_pytest/_io/saferepr.py b/src/_pytest/_io/saferepr.py index d817e3745..9b412dcca 100644 --- a/src/_pytest/_io/saferepr.py +++ b/src/_pytest/_io/saferepr.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pprint from six.moves import reprlib diff --git a/src/_pytest/assertion/__init__.py b/src/_pytest/assertion/__init__.py index b5c846c2c..6b6abb863 100644 --- a/src/_pytest/assertion/__init__.py +++ b/src/_pytest/assertion/__init__.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ support for presenting detailed information in failing assertions. """ diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index 2903b8995..68d41c4b9 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """Rewrite assertion AST to produce nice error messages""" from __future__ import absolute_import from __future__ import division diff --git a/src/_pytest/assertion/truncate.py b/src/_pytest/assertion/truncate.py index 69d6acdef..525896ea9 100644 --- a/src/_pytest/assertion/truncate.py +++ b/src/_pytest/assertion/truncate.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ Utilities for truncating assertion output. diff --git a/src/_pytest/assertion/util.py b/src/_pytest/assertion/util.py index b53646859..1fee64ce0 100644 --- a/src/_pytest/assertion/util.py +++ b/src/_pytest/assertion/util.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """Utilities for assertion debugging""" from __future__ import absolute_import from __future__ import division diff --git a/src/_pytest/cacheprovider.py b/src/_pytest/cacheprovider.py index aa4813c3f..3eaf7de28 100755 --- a/src/_pytest/cacheprovider.py +++ b/src/_pytest/cacheprovider.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ merged implementation of the cache provider diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py index 25eab7fdf..80f9c0442 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ per-test stdout/stderr capturing mechanism. diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py index fa878a485..19863dd83 100644 --- a/src/_pytest/compat.py +++ b/src/_pytest/compat.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ python version compatibility code """ diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 03769b815..f2ef45c29 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ command line options, ini-file and conftest.py processing. """ from __future__ import absolute_import from __future__ import division diff --git a/src/_pytest/config/argparsing.py b/src/_pytest/config/argparsing.py index cc48ed337..37fb772db 100644 --- a/src/_pytest/config/argparsing.py +++ b/src/_pytest/config/argparsing.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import argparse import warnings diff --git a/src/_pytest/config/exceptions.py b/src/_pytest/config/exceptions.py index 19fe5cb08..bf58fde5d 100644 --- a/src/_pytest/config/exceptions.py +++ b/src/_pytest/config/exceptions.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- class UsageError(Exception): """ error in pytest usage or invocation""" diff --git a/src/_pytest/config/findpaths.py b/src/_pytest/config/findpaths.py index fa2024470..3ece3bdc1 100644 --- a/src/_pytest/config/findpaths.py +++ b/src/_pytest/config/findpaths.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import os import py diff --git a/src/_pytest/debugging.py b/src/_pytest/debugging.py index 52c6536f4..139645b17 100644 --- a/src/_pytest/debugging.py +++ b/src/_pytest/debugging.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ interactive debugging with PDB, the Python Debugger. """ from __future__ import absolute_import from __future__ import division diff --git a/src/_pytest/deprecated.py b/src/_pytest/deprecated.py index b65700417..6283a8402 100644 --- a/src/_pytest/deprecated.py +++ b/src/_pytest/deprecated.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ This module contains deprecation messages and bits of code used elsewhere in the codebase that is planned to be removed in the next pytest release. diff --git a/src/_pytest/doctest.py b/src/_pytest/doctest.py index 34b6c9d8c..95a80bb4f 100644 --- a/src/_pytest/doctest.py +++ b/src/_pytest/doctest.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ discover and run doctests in modules and test files.""" from __future__ import absolute_import from __future__ import division diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index 902904457..ad2d376f1 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/src/_pytest/freeze_support.py b/src/_pytest/freeze_support.py index 5edf3454c..aeeec2a56 100644 --- a/src/_pytest/freeze_support.py +++ b/src/_pytest/freeze_support.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ Provides a function to report all internal modules for using freezing tools pytest diff --git a/src/_pytest/helpconfig.py b/src/_pytest/helpconfig.py index 2b383d264..fb4371d0e 100644 --- a/src/_pytest/helpconfig.py +++ b/src/_pytest/helpconfig.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ version info, help messages, tracing configuration. """ from __future__ import absolute_import from __future__ import division diff --git a/src/_pytest/hookspec.py b/src/_pytest/hookspec.py index d40a36811..7ab6154b1 100644 --- a/src/_pytest/hookspec.py +++ b/src/_pytest/hookspec.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ hook specifications for pytest plugins, invoked from main.py and builtin plugins. """ from pluggy import HookspecMarker diff --git a/src/_pytest/junitxml.py b/src/_pytest/junitxml.py index e3c98c37e..b58d8fab0 100644 --- a/src/_pytest/junitxml.py +++ b/src/_pytest/junitxml.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ report test results in JUnit-XML format, for use with Jenkins and build integration servers. diff --git a/src/_pytest/logging.py b/src/_pytest/logging.py index 08670d2b2..660912c91 100644 --- a/src/_pytest/logging.py +++ b/src/_pytest/logging.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ Access and control log capturing. """ from __future__ import absolute_import from __future__ import division diff --git a/src/_pytest/main.py b/src/_pytest/main.py index 96ead8509..fa4d8d3d5 100644 --- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ core implementation of testing process: init, session, runtest loop. """ from __future__ import absolute_import from __future__ import division diff --git a/src/_pytest/mark/__init__.py b/src/_pytest/mark/__init__.py index e98dc5c37..6bc22fe27 100644 --- a/src/_pytest/mark/__init__.py +++ b/src/_pytest/mark/__init__.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ generic mechanism for marking and selecting python functions. """ from __future__ import absolute_import from __future__ import division diff --git a/src/_pytest/mark/evaluate.py b/src/_pytest/mark/evaluate.py index 793bff79e..506546e25 100644 --- a/src/_pytest/mark/evaluate.py +++ b/src/_pytest/mark/evaluate.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import os import platform import sys diff --git a/src/_pytest/mark/legacy.py b/src/_pytest/mark/legacy.py index f784ffa20..c56482f14 100644 --- a/src/_pytest/mark/legacy.py +++ b/src/_pytest/mark/legacy.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ this is a place where we put datastructures used by legacy apis we hope ot remove diff --git a/src/_pytest/mark/structures.py b/src/_pytest/mark/structures.py index a734ae1d4..b133a4e26 100644 --- a/src/_pytest/mark/structures.py +++ b/src/_pytest/mark/structures.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import inspect import warnings from collections import namedtuple diff --git a/src/_pytest/monkeypatch.py b/src/_pytest/monkeypatch.py index 3e221d3d9..e8671b0c7 100644 --- a/src/_pytest/monkeypatch.py +++ b/src/_pytest/monkeypatch.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ monkeypatching and mocking functionality. """ from __future__ import absolute_import from __future__ import division diff --git a/src/_pytest/nodes.py b/src/_pytest/nodes.py index 4dd0e1785..7342d9607 100644 --- a/src/_pytest/nodes.py +++ b/src/_pytest/nodes.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/src/_pytest/nose.py b/src/_pytest/nose.py index 492388260..fbab91da2 100644 --- a/src/_pytest/nose.py +++ b/src/_pytest/nose.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ run test suites written for nose. """ from __future__ import absolute_import from __future__ import division diff --git a/src/_pytest/outcomes.py b/src/_pytest/outcomes.py index f57983918..48e2b7367 100644 --- a/src/_pytest/outcomes.py +++ b/src/_pytest/outcomes.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ exception classes and constants handling test outcomes as well as functions creating them diff --git a/src/_pytest/pastebin.py b/src/_pytest/pastebin.py index 9559e3265..3f4171207 100644 --- a/src/_pytest/pastebin.py +++ b/src/_pytest/pastebin.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ submit failure or test session information to a pastebin service. """ from __future__ import absolute_import from __future__ import division diff --git a/src/_pytest/pathlib.py b/src/_pytest/pathlib.py index 5dd00e74f..729c41797 100644 --- a/src/_pytest/pathlib.py +++ b/src/_pytest/pathlib.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import atexit import errno import fnmatch diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py index 413b21824..21f5b9f24 100644 --- a/src/_pytest/pytester.py +++ b/src/_pytest/pytester.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """(disabled by default) support for testing pytest and pytest plugins.""" from __future__ import absolute_import from __future__ import division diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 18d909855..f55617e2d 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ Python test discovery, setup and run of test functions. """ from __future__ import absolute_import from __future__ import division diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index 7e7570008..e2fcdfc28 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from __future__ import absolute_import import math diff --git a/src/_pytest/recwarn.py b/src/_pytest/recwarn.py index 394d91911..574c6a1cc 100644 --- a/src/_pytest/recwarn.py +++ b/src/_pytest/recwarn.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ recording warnings during test function execution. """ from __future__ import absolute_import from __future__ import division diff --git a/src/_pytest/reports.py b/src/_pytest/reports.py index 43d7e54a4..0bba6762c 100644 --- a/src/_pytest/reports.py +++ b/src/_pytest/reports.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from pprint import pprint import py diff --git a/src/_pytest/resultlog.py b/src/_pytest/resultlog.py index cd3fde80f..bd30b5071 100644 --- a/src/_pytest/resultlog.py +++ b/src/_pytest/resultlog.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ log machine-parseable test session result information in a plain text file. """ diff --git a/src/_pytest/runner.py b/src/_pytest/runner.py index 7fb343d4e..d51e859f1 100644 --- a/src/_pytest/runner.py +++ b/src/_pytest/runner.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ basic collect and runtest protocol implementations """ from __future__ import absolute_import from __future__ import division diff --git a/src/_pytest/setuponly.py b/src/_pytest/setuponly.py index 4bd4ad6d8..085901124 100644 --- a/src/_pytest/setuponly.py +++ b/src/_pytest/setuponly.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/src/_pytest/setupplan.py b/src/_pytest/setupplan.py index 351e0be65..47b0fe82e 100644 --- a/src/_pytest/setupplan.py +++ b/src/_pytest/setupplan.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/src/_pytest/skipping.py b/src/_pytest/skipping.py index 94a43de49..bc8b88e71 100644 --- a/src/_pytest/skipping.py +++ b/src/_pytest/skipping.py @@ -1,4 +1,4 @@ -# coding: utf-8 +# -*- coding: utf-8 -*- """ support for skip/xfail functions and markers. """ from __future__ import absolute_import from __future__ import division diff --git a/src/_pytest/stepwise.py b/src/_pytest/stepwise.py index 68e53a31c..0427cd0ea 100644 --- a/src/_pytest/stepwise.py +++ b/src/_pytest/stepwise.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pytest diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index 771e6a835..81e3f1809 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -1,4 +1,4 @@ -# encoding: utf-8 +# -*- coding: utf-8 -*- """ terminal reporting of the full testing process. This is a good source for looking at the various reporting hooks. diff --git a/src/_pytest/tmpdir.py b/src/_pytest/tmpdir.py index 4d109cc2b..f1b16fb5c 100644 --- a/src/_pytest/tmpdir.py +++ b/src/_pytest/tmpdir.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ support for providing temporary directories to test functions. """ from __future__ import absolute_import from __future__ import division diff --git a/src/_pytest/unittest.py b/src/_pytest/unittest.py index 58d79845b..e2e7efdc5 100644 --- a/src/_pytest/unittest.py +++ b/src/_pytest/unittest.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ discovery and running of std-library "unittest" style tests. """ from __future__ import absolute_import from __future__ import division diff --git a/src/_pytest/warning_types.py b/src/_pytest/warning_types.py index 2777aabea..861010a12 100644 --- a/src/_pytest/warning_types.py +++ b/src/_pytest/warning_types.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import attr diff --git a/src/_pytest/warnings.py b/src/_pytest/warnings.py index 3360aea9c..a3debae46 100644 --- a/src/_pytest/warnings.py +++ b/src/_pytest/warnings.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/src/pytest.py b/src/pytest.py index a6376843d..ccc77b476 100644 --- a/src/pytest.py +++ b/src/pytest.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # PYTHON_ARGCOMPLETE_OK """ pytest: unit and functional testing with Python. diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index a6bf93459..b0c682900 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_code.py b/testing/code/test_code.py index 81a87481c..0b63fcf4d 100644 --- a/testing/code/test_code.py +++ b/testing/code/test_code.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 09e96a45f..a76797301 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 7a9e8b79f..0a2a98c02 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/conftest.py b/testing/conftest.py index 4582c7d90..ecc945279 100644 --- a/testing/conftest.py +++ b/testing/conftest.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pytest diff --git a/testing/deprecated_test.py b/testing/deprecated_test.py index 4818379fe..a072f6b21 100644 --- a/testing/deprecated_test.py +++ b/testing/deprecated_test.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/testing/example_scripts/acceptance/fixture_mock_integration.py b/testing/example_scripts/acceptance/fixture_mock_integration.py index c005c9193..c8ccdf1b4 100644 --- a/testing/example_scripts/acceptance/fixture_mock_integration.py +++ b/testing/example_scripts/acceptance/fixture_mock_integration.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """Reproduces issue #3774""" try: diff --git a/testing/example_scripts/collect/collect_init_tests/tests/__init__.py b/testing/example_scripts/collect/collect_init_tests/tests/__init__.py index 9cd366295..621105571 100644 --- a/testing/example_scripts/collect/collect_init_tests/tests/__init__.py +++ b/testing/example_scripts/collect/collect_init_tests/tests/__init__.py @@ -1,2 +1,3 @@ +# -*- coding: utf-8 -*- def test_init(): pass diff --git a/testing/example_scripts/collect/collect_init_tests/tests/test_foo.py b/testing/example_scripts/collect/collect_init_tests/tests/test_foo.py index 8f2d73cfa..8c560fd13 100644 --- a/testing/example_scripts/collect/collect_init_tests/tests/test_foo.py +++ b/testing/example_scripts/collect/collect_init_tests/tests/test_foo.py @@ -1,2 +1,3 @@ +# -*- coding: utf-8 -*- def test_foo(): pass diff --git a/testing/example_scripts/collect/package_infinite_recursion/conftest.py b/testing/example_scripts/collect/package_infinite_recursion/conftest.py index 9629fa646..9c3d9a791 100644 --- a/testing/example_scripts/collect/package_infinite_recursion/conftest.py +++ b/testing/example_scripts/collect/package_infinite_recursion/conftest.py @@ -1,2 +1,3 @@ +# -*- coding: utf-8 -*- def pytest_ignore_collect(path): return False diff --git a/testing/example_scripts/collect/package_infinite_recursion/tests/test_basic.py b/testing/example_scripts/collect/package_infinite_recursion/tests/test_basic.py index f17482385..10c5f6052 100644 --- a/testing/example_scripts/collect/package_infinite_recursion/tests/test_basic.py +++ b/testing/example_scripts/collect/package_infinite_recursion/tests/test_basic.py @@ -1,2 +1,3 @@ +# -*- coding: utf-8 -*- def test(): pass diff --git a/testing/example_scripts/collect/package_init_given_as_arg/pkg/test_foo.py b/testing/example_scripts/collect/package_init_given_as_arg/pkg/test_foo.py index f17482385..10c5f6052 100644 --- a/testing/example_scripts/collect/package_init_given_as_arg/pkg/test_foo.py +++ b/testing/example_scripts/collect/package_init_given_as_arg/pkg/test_foo.py @@ -1,2 +1,3 @@ +# -*- coding: utf-8 -*- def test(): pass diff --git a/testing/example_scripts/config/collect_pytest_prefix/conftest.py b/testing/example_scripts/config/collect_pytest_prefix/conftest.py index 56a4c71d3..13397ccc4 100644 --- a/testing/example_scripts/config/collect_pytest_prefix/conftest.py +++ b/testing/example_scripts/config/collect_pytest_prefix/conftest.py @@ -1,2 +1,3 @@ +# -*- coding: utf-8 -*- class pytest_something(object): pass diff --git a/testing/example_scripts/config/collect_pytest_prefix/test_foo.py b/testing/example_scripts/config/collect_pytest_prefix/test_foo.py index 8f2d73cfa..8c560fd13 100644 --- a/testing/example_scripts/config/collect_pytest_prefix/test_foo.py +++ b/testing/example_scripts/config/collect_pytest_prefix/test_foo.py @@ -1,2 +1,3 @@ +# -*- coding: utf-8 -*- def test_foo(): pass diff --git a/testing/example_scripts/conftest_usageerror/conftest.py b/testing/example_scripts/conftest_usageerror/conftest.py index 8973e4252..d2f040578 100644 --- a/testing/example_scripts/conftest_usageerror/conftest.py +++ b/testing/example_scripts/conftest_usageerror/conftest.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- def pytest_configure(config): import pytest diff --git a/testing/example_scripts/dataclasses/test_compare_dataclasses.py b/testing/example_scripts/dataclasses/test_compare_dataclasses.py index 3bbebe2aa..5381b5ed0 100644 --- a/testing/example_scripts/dataclasses/test_compare_dataclasses.py +++ b/testing/example_scripts/dataclasses/test_compare_dataclasses.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from dataclasses import dataclass from dataclasses import field diff --git a/testing/example_scripts/dataclasses/test_compare_dataclasses_field_comparison_off.py b/testing/example_scripts/dataclasses/test_compare_dataclasses_field_comparison_off.py index 63b9f534e..d418dd6b0 100644 --- a/testing/example_scripts/dataclasses/test_compare_dataclasses_field_comparison_off.py +++ b/testing/example_scripts/dataclasses/test_compare_dataclasses_field_comparison_off.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from dataclasses import dataclass from dataclasses import field diff --git a/testing/example_scripts/dataclasses/test_compare_dataclasses_verbose.py b/testing/example_scripts/dataclasses/test_compare_dataclasses_verbose.py index 17835c0c3..a72ca5119 100644 --- a/testing/example_scripts/dataclasses/test_compare_dataclasses_verbose.py +++ b/testing/example_scripts/dataclasses/test_compare_dataclasses_verbose.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from dataclasses import dataclass from dataclasses import field diff --git a/testing/example_scripts/dataclasses/test_compare_two_different_dataclasses.py b/testing/example_scripts/dataclasses/test_compare_two_different_dataclasses.py index 24f185d8a..b77b70d3c 100644 --- a/testing/example_scripts/dataclasses/test_compare_two_different_dataclasses.py +++ b/testing/example_scripts/dataclasses/test_compare_two_different_dataclasses.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from dataclasses import dataclass from dataclasses import field diff --git a/testing/example_scripts/deprecated/test_fixture_named_request.py b/testing/example_scripts/deprecated/test_fixture_named_request.py index 75514bf8b..36addc299 100644 --- a/testing/example_scripts/deprecated/test_fixture_named_request.py +++ b/testing/example_scripts/deprecated/test_fixture_named_request.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pytest diff --git a/testing/example_scripts/fixtures/custom_item/conftest.py b/testing/example_scripts/fixtures/custom_item/conftest.py index 25299d726..fa41d0fba 100644 --- a/testing/example_scripts/fixtures/custom_item/conftest.py +++ b/testing/example_scripts/fixtures/custom_item/conftest.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pytest diff --git a/testing/example_scripts/fixtures/custom_item/foo/test_foo.py b/testing/example_scripts/fixtures/custom_item/foo/test_foo.py index f17482385..10c5f6052 100644 --- a/testing/example_scripts/fixtures/custom_item/foo/test_foo.py +++ b/testing/example_scripts/fixtures/custom_item/foo/test_foo.py @@ -1,2 +1,3 @@ +# -*- coding: utf-8 -*- def test(): pass diff --git a/testing/example_scripts/fixtures/fill_fixtures/test_conftest_funcargs_only_available_in_subdir/sub1/conftest.py b/testing/example_scripts/fixtures/fill_fixtures/test_conftest_funcargs_only_available_in_subdir/sub1/conftest.py index 79af4bc47..952e7d60a 100644 --- a/testing/example_scripts/fixtures/fill_fixtures/test_conftest_funcargs_only_available_in_subdir/sub1/conftest.py +++ b/testing/example_scripts/fixtures/fill_fixtures/test_conftest_funcargs_only_available_in_subdir/sub1/conftest.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pytest diff --git a/testing/example_scripts/fixtures/fill_fixtures/test_conftest_funcargs_only_available_in_subdir/sub1/test_in_sub1.py b/testing/example_scripts/fixtures/fill_fixtures/test_conftest_funcargs_only_available_in_subdir/sub1/test_in_sub1.py index df36da136..b824f4e99 100644 --- a/testing/example_scripts/fixtures/fill_fixtures/test_conftest_funcargs_only_available_in_subdir/sub1/test_in_sub1.py +++ b/testing/example_scripts/fixtures/fill_fixtures/test_conftest_funcargs_only_available_in_subdir/sub1/test_in_sub1.py @@ -1,2 +1,3 @@ +# -*- coding: utf-8 -*- def test_1(arg1): pass diff --git a/testing/example_scripts/fixtures/fill_fixtures/test_conftest_funcargs_only_available_in_subdir/sub2/conftest.py b/testing/example_scripts/fixtures/fill_fixtures/test_conftest_funcargs_only_available_in_subdir/sub2/conftest.py index 00981c5dc..2be90b4df 100644 --- a/testing/example_scripts/fixtures/fill_fixtures/test_conftest_funcargs_only_available_in_subdir/sub2/conftest.py +++ b/testing/example_scripts/fixtures/fill_fixtures/test_conftest_funcargs_only_available_in_subdir/sub2/conftest.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pytest diff --git a/testing/example_scripts/fixtures/fill_fixtures/test_conftest_funcargs_only_available_in_subdir/sub2/test_in_sub2.py b/testing/example_scripts/fixtures/fill_fixtures/test_conftest_funcargs_only_available_in_subdir/sub2/test_in_sub2.py index 1c34f94ac..a1432042b 100644 --- a/testing/example_scripts/fixtures/fill_fixtures/test_conftest_funcargs_only_available_in_subdir/sub2/test_in_sub2.py +++ b/testing/example_scripts/fixtures/fill_fixtures/test_conftest_funcargs_only_available_in_subdir/sub2/test_in_sub2.py @@ -1,2 +1,3 @@ +# -*- coding: utf-8 -*- def test_2(arg2): pass diff --git a/testing/example_scripts/fixtures/fill_fixtures/test_detect_recursive_dependency_error.py b/testing/example_scripts/fixtures/fill_fixtures/test_detect_recursive_dependency_error.py index d1efcbb33..d1e54eea7 100644 --- a/testing/example_scripts/fixtures/fill_fixtures/test_detect_recursive_dependency_error.py +++ b/testing/example_scripts/fixtures/fill_fixtures/test_detect_recursive_dependency_error.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pytest diff --git a/testing/example_scripts/fixtures/fill_fixtures/test_extend_fixture_conftest_conftest/conftest.py b/testing/example_scripts/fixtures/fill_fixtures/test_extend_fixture_conftest_conftest/conftest.py index 5dfd2f779..87756e649 100644 --- a/testing/example_scripts/fixtures/fill_fixtures/test_extend_fixture_conftest_conftest/conftest.py +++ b/testing/example_scripts/fixtures/fill_fixtures/test_extend_fixture_conftest_conftest/conftest.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pytest diff --git a/testing/example_scripts/fixtures/fill_fixtures/test_extend_fixture_conftest_conftest/pkg/conftest.py b/testing/example_scripts/fixtures/fill_fixtures/test_extend_fixture_conftest_conftest/pkg/conftest.py index 4e22ce5a1..1cd88524b 100644 --- a/testing/example_scripts/fixtures/fill_fixtures/test_extend_fixture_conftest_conftest/pkg/conftest.py +++ b/testing/example_scripts/fixtures/fill_fixtures/test_extend_fixture_conftest_conftest/pkg/conftest.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pytest diff --git a/testing/example_scripts/fixtures/fill_fixtures/test_extend_fixture_conftest_conftest/pkg/test_spam.py b/testing/example_scripts/fixtures/fill_fixtures/test_extend_fixture_conftest_conftest/pkg/test_spam.py index 0d891fbb5..65690c49f 100644 --- a/testing/example_scripts/fixtures/fill_fixtures/test_extend_fixture_conftest_conftest/pkg/test_spam.py +++ b/testing/example_scripts/fixtures/fill_fixtures/test_extend_fixture_conftest_conftest/pkg/test_spam.py @@ -1,2 +1,3 @@ +# -*- coding: utf-8 -*- def test_spam(spam): assert spam == "spamspam" diff --git a/testing/example_scripts/fixtures/fill_fixtures/test_extend_fixture_conftest_module/conftest.py b/testing/example_scripts/fixtures/fill_fixtures/test_extend_fixture_conftest_module/conftest.py index 5dfd2f779..87756e649 100644 --- a/testing/example_scripts/fixtures/fill_fixtures/test_extend_fixture_conftest_module/conftest.py +++ b/testing/example_scripts/fixtures/fill_fixtures/test_extend_fixture_conftest_module/conftest.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pytest diff --git a/testing/example_scripts/fixtures/fill_fixtures/test_extend_fixture_conftest_module/test_extend_fixture_conftest_module.py b/testing/example_scripts/fixtures/fill_fixtures/test_extend_fixture_conftest_module/test_extend_fixture_conftest_module.py index 46d1446f4..5b344c122 100644 --- a/testing/example_scripts/fixtures/fill_fixtures/test_extend_fixture_conftest_module/test_extend_fixture_conftest_module.py +++ b/testing/example_scripts/fixtures/fill_fixtures/test_extend_fixture_conftest_module/test_extend_fixture_conftest_module.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pytest diff --git a/testing/example_scripts/fixtures/fill_fixtures/test_extend_fixture_module_class.py b/testing/example_scripts/fixtures/fill_fixtures/test_extend_fixture_module_class.py index 2b8218ed7..4332c6601 100644 --- a/testing/example_scripts/fixtures/fill_fixtures/test_extend_fixture_module_class.py +++ b/testing/example_scripts/fixtures/fill_fixtures/test_extend_fixture_module_class.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pytest diff --git a/testing/example_scripts/fixtures/fill_fixtures/test_funcarg_basic.py b/testing/example_scripts/fixtures/fill_fixtures/test_funcarg_basic.py index 0661cb301..ba302c49e 100644 --- a/testing/example_scripts/fixtures/fill_fixtures/test_funcarg_basic.py +++ b/testing/example_scripts/fixtures/fill_fixtures/test_funcarg_basic.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pytest diff --git a/testing/example_scripts/fixtures/fill_fixtures/test_funcarg_lookup_classlevel.py b/testing/example_scripts/fixtures/fill_fixtures/test_funcarg_lookup_classlevel.py index 7b7183dd9..1004d5d13 100644 --- a/testing/example_scripts/fixtures/fill_fixtures/test_funcarg_lookup_classlevel.py +++ b/testing/example_scripts/fixtures/fill_fixtures/test_funcarg_lookup_classlevel.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pytest diff --git a/testing/example_scripts/fixtures/fill_fixtures/test_funcarg_lookup_modulelevel.py b/testing/example_scripts/fixtures/fill_fixtures/test_funcarg_lookup_modulelevel.py index 227abb593..79d283e9f 100644 --- a/testing/example_scripts/fixtures/fill_fixtures/test_funcarg_lookup_modulelevel.py +++ b/testing/example_scripts/fixtures/fill_fixtures/test_funcarg_lookup_modulelevel.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pytest diff --git a/testing/example_scripts/fixtures/fill_fixtures/test_funcarg_lookupfails.py b/testing/example_scripts/fixtures/fill_fixtures/test_funcarg_lookupfails.py index b77520323..18f426af9 100644 --- a/testing/example_scripts/fixtures/fill_fixtures/test_funcarg_lookupfails.py +++ b/testing/example_scripts/fixtures/fill_fixtures/test_funcarg_lookupfails.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pytest diff --git a/testing/example_scripts/fixtures/test_getfixturevalue_dynamic.py b/testing/example_scripts/fixtures/test_getfixturevalue_dynamic.py index 055a1220b..219e57421 100644 --- a/testing/example_scripts/fixtures/test_getfixturevalue_dynamic.py +++ b/testing/example_scripts/fixtures/test_getfixturevalue_dynamic.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pytest diff --git a/testing/example_scripts/issue88_initial_file_multinodes/conftest.py b/testing/example_scripts/issue88_initial_file_multinodes/conftest.py index aa5d87831..8f3e7b4e5 100644 --- a/testing/example_scripts/issue88_initial_file_multinodes/conftest.py +++ b/testing/example_scripts/issue88_initial_file_multinodes/conftest.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pytest diff --git a/testing/example_scripts/issue88_initial_file_multinodes/test_hello.py b/testing/example_scripts/issue88_initial_file_multinodes/test_hello.py index 56444d147..653d570a8 100644 --- a/testing/example_scripts/issue88_initial_file_multinodes/test_hello.py +++ b/testing/example_scripts/issue88_initial_file_multinodes/test_hello.py @@ -1,2 +1,3 @@ +# -*- coding: utf-8 -*- def test_hello(): pass diff --git a/testing/example_scripts/issue_519.py b/testing/example_scripts/issue_519.py index 7199df820..24d864a53 100644 --- a/testing/example_scripts/issue_519.py +++ b/testing/example_scripts/issue_519.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pprint import pytest diff --git a/testing/example_scripts/marks/marks_considered_keywords/test_marks_as_keywords.py b/testing/example_scripts/marks/marks_considered_keywords/test_marks_as_keywords.py index 35a2c7b76..61d969a36 100644 --- a/testing/example_scripts/marks/marks_considered_keywords/test_marks_as_keywords.py +++ b/testing/example_scripts/marks/marks_considered_keywords/test_marks_as_keywords.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pytest diff --git a/testing/example_scripts/perf_examples/collect_stats/generate_folders.py b/testing/example_scripts/perf_examples/collect_stats/generate_folders.py index ff1eaf7d6..32ca818ea 100644 --- a/testing/example_scripts/perf_examples/collect_stats/generate_folders.py +++ b/testing/example_scripts/perf_examples/collect_stats/generate_folders.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import argparse import pathlib diff --git a/testing/example_scripts/perf_examples/collect_stats/template_test.py b/testing/example_scripts/perf_examples/collect_stats/template_test.py index 064ade190..5d0cd5a71 100644 --- a/testing/example_scripts/perf_examples/collect_stats/template_test.py +++ b/testing/example_scripts/perf_examples/collect_stats/template_test.py @@ -1,2 +1,3 @@ +# -*- coding: utf-8 -*- def test_x(): pass diff --git a/testing/example_scripts/tmpdir/tmpdir_fixture.py b/testing/example_scripts/tmpdir/tmpdir_fixture.py index f4ad07462..33f0315d5 100644 --- a/testing/example_scripts/tmpdir/tmpdir_fixture.py +++ b/testing/example_scripts/tmpdir/tmpdir_fixture.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pytest diff --git a/testing/example_scripts/unittest/test_parametrized_fixture_error_message.py b/testing/example_scripts/unittest/test_parametrized_fixture_error_message.py index d421ce927..cef950ee7 100644 --- a/testing/example_scripts/unittest/test_parametrized_fixture_error_message.py +++ b/testing/example_scripts/unittest/test_parametrized_fixture_error_message.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import unittest import pytest diff --git a/testing/example_scripts/unittest/test_setup_skip.py b/testing/example_scripts/unittest/test_setup_skip.py index 93f79bb3b..26b6195e9 100644 --- a/testing/example_scripts/unittest/test_setup_skip.py +++ b/testing/example_scripts/unittest/test_setup_skip.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """Skipping an entire subclass with unittest.skip() should *not* call setUp from a base class.""" import unittest diff --git a/testing/example_scripts/unittest/test_setup_skip_class.py b/testing/example_scripts/unittest/test_setup_skip_class.py index 4f251dcba..0c4a37757 100644 --- a/testing/example_scripts/unittest/test_setup_skip_class.py +++ b/testing/example_scripts/unittest/test_setup_skip_class.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """Skipping an entire subclass with unittest.skip() should *not* call setUpClass from a base class.""" import unittest diff --git a/testing/example_scripts/unittest/test_setup_skip_module.py b/testing/example_scripts/unittest/test_setup_skip_module.py index 98befbe51..abf782a62 100644 --- a/testing/example_scripts/unittest/test_setup_skip_module.py +++ b/testing/example_scripts/unittest/test_setup_skip_module.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """setUpModule is always called, even if all tests in the module are skipped""" import unittest diff --git a/testing/example_scripts/warnings/test_group_warnings_by_message.py b/testing/example_scripts/warnings/test_group_warnings_by_message.py index c736135b7..29d895974 100644 --- a/testing/example_scripts/warnings/test_group_warnings_by_message.py +++ b/testing/example_scripts/warnings/test_group_warnings_by_message.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import warnings import pytest diff --git a/testing/examples/test_issue519.py b/testing/examples/test_issue519.py index e83f18fdc..7da1f4ee6 100644 --- a/testing/examples/test_issue519.py +++ b/testing/examples/test_issue519.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- def test_510(testdir): testdir.copy_example("issue_519.py") testdir.runpytest("issue_519.py") diff --git a/testing/freeze/create_executable.py b/testing/freeze/create_executable.py index b53eb09f5..ab8013317 100644 --- a/testing/freeze/create_executable.py +++ b/testing/freeze/create_executable.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ Generates an executable with pytest runner embedded using PyInstaller. """ diff --git a/testing/freeze/runtests_script.py b/testing/freeze/runtests_script.py index d03bca840..f7381f568 100644 --- a/testing/freeze/runtests_script.py +++ b/testing/freeze/runtests_script.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ This is the script that is actually frozen into an executable: simply executes py.test main(). diff --git a/testing/freeze/tests/test_trivial.py b/testing/freeze/tests/test_trivial.py index 08a55552a..449dbf9d3 100644 --- a/testing/freeze/tests/test_trivial.py +++ b/testing/freeze/tests/test_trivial.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- def test_upper(): assert "foo".upper() == "FOO" diff --git a/testing/freeze/tox_run.py b/testing/freeze/tox_run.py index 678a69c85..29b727923 100644 --- a/testing/freeze/tox_run.py +++ b/testing/freeze/tox_run.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ Called by tox.ini: uses the generated executable to run the tests in ./tests/ directory. diff --git a/testing/io/test_saferepr.py b/testing/io/test_saferepr.py index abee94999..901203088 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 89065b086..ff772e7ec 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_formatter.py b/testing/logging/test_formatter.py index abceaf857..1610da845 100644 --- a/testing/logging/test_formatter.py +++ b/testing/logging/test_formatter.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import logging import py.io diff --git a/testing/logging/test_reporting.py b/testing/logging/test_reporting.py index ce6892492..77cf71b43 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/approx.py b/testing/python/approx.py index 26e6a4ab2..cd8df5d27 100644 --- a/testing/python/approx.py +++ b/testing/python/approx.py @@ -1,4 +1,4 @@ -# encoding: utf-8 +# -*- coding: utf-8 -*- import doctest import operator import sys diff --git a/testing/python/collect.py b/testing/python/collect.py index 3b5e9dd42..bfd7e672e 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 2f64b1be2..18ede4006 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/integration.py b/testing/python/integration.py index a62747014..d2fea2dc5 100644 --- a/testing/python/integration.py +++ b/testing/python/integration.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pytest from _pytest import python from _pytest import runner diff --git a/testing/python/metafunc.py b/testing/python/metafunc.py index 2a84a7a57..29f18da36 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/raises.py b/testing/python/raises.py index f5827e9b0..cd463d74b 100644 --- a/testing/python/raises.py +++ b/testing/python/raises.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import sys import six diff --git a/testing/python/setup_only.py b/testing/python/setup_only.py index 4ae24b15a..ba4ceb00f 100644 --- a/testing/python/setup_only.py +++ b/testing/python/setup_only.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pytest diff --git a/testing/python/setup_plan.py b/testing/python/setup_plan.py index 0321939a8..ad64e42c2 100644 --- a/testing/python/setup_plan.py +++ b/testing/python/setup_plan.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- def test_show_fixtures_and_test(testdir): """ Verifies that fixtures are not executed. """ p = testdir.makepyfile( diff --git a/testing/python/show_fixtures_per_test.py b/testing/python/show_fixtures_per_test.py index f677b3067..e14344d4e 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_argcomplete.py b/testing/test_argcomplete.py index 046d69aa0..da7758e8e 100644 --- a/testing/test_argcomplete.py +++ b/testing/test_argcomplete.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/testing/test_assertion.py b/testing/test_assertion.py index 7d92b1bac..8a59b7e8d 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 5b527ca22..87dada213 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_cacheprovider.py b/testing/test_cacheprovider.py index 02c758424..5024701f1 100644 --- a/testing/test_cacheprovider.py +++ b/testing/test_cacheprovider.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/testing/test_capture.py b/testing/test_capture.py index 42bb4b8aa..7f757c6d6 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_collection.py b/testing/test_collection.py index 5aaaddbea..1cc893866 100644 --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/testing/test_compat.py b/testing/test_compat.py index 6c4d24398..b4298d153 100644 --- a/testing/test_compat.py +++ b/testing/test_compat.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/testing/test_config.py b/testing/test_config.py index ecb8fd403..325f4858e 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/testing/test_conftest.py b/testing/test_conftest.py index acb9b52b4..f8e3dfa92 100644 --- a/testing/test_conftest.py +++ b/testing/test_conftest.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/testing/test_doctest.py b/testing/test_doctest.py index 164fdc423..25a35c3c1 100644 --- a/testing/test_doctest.py +++ b/testing/test_doctest.py @@ -1,4 +1,4 @@ -# encoding: utf-8 +# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function @@ -581,7 +581,7 @@ class TestDoctests(object): """ testdir.makepyfile( u''' - # encoding: utf-8 + # -*- coding: utf-8 -*- def foo(): """ >>> name = 'с' # not letter 'c' but instead Cyrillic 's'. @@ -658,7 +658,7 @@ class TestDoctests(object): """ p = testdir.makepyfile( test_unicode_doctest_module=""" - # encoding: utf-8 + # -*- coding: utf-8 -*- from __future__ import unicode_literals def fix_bad_unicode(text): diff --git a/testing/test_entry_points.py b/testing/test_entry_points.py index dcb9dd525..af1db04bc 100644 --- a/testing/test_entry_points.py +++ b/testing/test_entry_points.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/testing/test_helpconfig.py b/testing/test_helpconfig.py index 9c7806d54..75888fe14 100644 --- a/testing/test_helpconfig.py +++ b/testing/test_helpconfig.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/testing/test_junitxml.py b/testing/test_junitxml.py index 41b27e275..cca0143a2 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_mark.py b/testing/test_mark.py index b2f893438..5bd97d547 100644 --- a/testing/test_mark.py +++ b/testing/test_mark.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/testing/test_modimport.py b/testing/test_modimport.py index 3d7a07323..5dd057c55 100644 --- a/testing/test_modimport.py +++ b/testing/test_modimport.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import subprocess import sys diff --git a/testing/test_monkeypatch.py b/testing/test_monkeypatch.py index 9e45e05c8..9b2f45502 100644 --- a/testing/test_monkeypatch.py +++ b/testing/test_monkeypatch.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/testing/test_nodes.py b/testing/test_nodes.py index b13ce1fe6..e86bd5f79 100644 --- a/testing/test_nodes.py +++ b/testing/test_nodes.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import py import pytest diff --git a/testing/test_nose.py b/testing/test_nose.py index 2fe49177a..6eb5f085e 100644 --- a/testing/test_nose.py +++ b/testing/test_nose.py @@ -1,4 +1,4 @@ -# encoding: utf-8 +# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function @@ -372,7 +372,7 @@ def test_nottest_class_decorator(testdir): def test_skip_test_with_unicode(testdir): testdir.makepyfile( """ - # encoding: utf-8 + # -*- coding: utf-8 -*- import unittest class TestClass(): def test_io(self): diff --git a/testing/test_parseopt.py b/testing/test_parseopt.py index 91f9a7d2b..c570ed60b 100644 --- a/testing/test_parseopt.py +++ b/testing/test_parseopt.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/testing/test_pastebin.py b/testing/test_pastebin.py index 04f316e52..9491f6d90 100644 --- a/testing/test_pastebin.py +++ b/testing/test_pastebin.py @@ -1,4 +1,4 @@ -# encoding: utf-8 +# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function @@ -68,7 +68,7 @@ class TestPasteCapture(object): """ testdir.makepyfile( test_unicode=""" - # encoding: utf-8 + # -*- coding: utf-8 -*- def test(): assert '☺' == 1 """ diff --git a/testing/test_pathlib.py b/testing/test_pathlib.py index 8ac404070..541d289f7 100644 --- a/testing/test_pathlib.py +++ b/testing/test_pathlib.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import sys import py diff --git a/testing/test_pdb.py b/testing/test_pdb.py index 3b21bacd9..ed38a6133 100644 --- a/testing/test_pdb.py +++ b/testing/test_pdb.py @@ -1,3 +1,4 @@ +# -*- 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 423a20c29..236551643 100644 --- a/testing/test_pluginmanager.py +++ b/testing/test_pluginmanager.py @@ -1,4 +1,4 @@ -# encoding: utf-8 +# -*- coding: 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 + # -*- coding: 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 bf6e5d97e..b76d413b7 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_recwarn.py b/testing/test_recwarn.py index 982e246d7..2246085f5 100644 --- a/testing/test_recwarn.py +++ b/testing/test_recwarn.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/testing/test_reports.py b/testing/test_reports.py index 6d2b167f8..5c6851e49 100644 --- a/testing/test_reports.py +++ b/testing/test_reports.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pytest from _pytest.pathlib import Path from _pytest.reports import CollectReport diff --git a/testing/test_resultlog.py b/testing/test_resultlog.py index aba5713af..1ef49d5e2 100644 --- a/testing/test_resultlog.py +++ b/testing/test_resultlog.py @@ -1,3 +1,4 @@ +# -*- 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 7ab63b346..6906efb91 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 @@ -645,7 +645,7 @@ def test_pytest_fail_notrace_non_ascii(testdir, str_prefix): """ testdir.makepyfile( u""" - # coding: utf-8 + # -*- coding: utf-8 -*- import pytest def test_hello(): @@ -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_runner_xunit.py b/testing/test_runner_xunit.py index 6b5752b77..5be7297f6 100644 --- a/testing/test_runner_xunit.py +++ b/testing/test_runner_xunit.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ test correct setup/teardowns at module, class, and instance level diff --git a/testing/test_session.py b/testing/test_session.py index 377b28937..c4b0eea79 100644 --- a/testing/test_session.py +++ b/testing/test_session.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/testing/test_skipping.py b/testing/test_skipping.py index 8df726bc8..38273073d 100644 --- a/testing/test_skipping.py +++ b/testing/test_skipping.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_stepwise.py b/testing/test_stepwise.py index 2202bbf1b..68e5989ec 100644 --- a/testing/test_stepwise.py +++ b/testing/test_stepwise.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pytest diff --git a/testing/test_terminal.py b/testing/test_terminal.py index f269fccd2..fef73c4a9 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -1,4 +1,4 @@ -# encoding: utf-8 +# -*- coding: utf-8 -*- """ terminal reporting of the full testing process. """ diff --git a/testing/test_tmpdir.py b/testing/test_tmpdir.py index c49f7930d..40ffe98af 100644 --- a/testing/test_tmpdir.py +++ b/testing/test_tmpdir.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/testing/test_unittest.py b/testing/test_unittest.py index 78250dae3..bb41952ab 100644 --- a/testing/test_unittest.py +++ b/testing/test_unittest.py @@ -1,3 +1,4 @@ +# -*- 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 ce157cbed..092604d7d 100644 --- a/testing/test_warnings.py +++ b/testing/test_warnings.py @@ -1,4 +1,4 @@ -# coding: utf-8 +# -*- 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: utf-8 + # -*- 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: utf-8 + # -*- coding: utf-8 -*- import warnings import pytest @@ -577,7 +577,7 @@ def test_infinite_loop_warning_against_unicode_usage_py2(testdir): """ testdir.makepyfile( """ - # coding: utf-8 + # -*- coding: utf-8 -*- from __future__ import unicode_literals import warnings import pytest