Skip to content

Commit a122ae8

Browse files
Merge pull request #2316 from nicoddemus/add-future-imports
Add __future__ imports to all pytest modules
2 parents 5482dfe + 4d94707 commit a122ae8

Some content is hidden

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

74 files changed

+119
-47
lines changed

CONTRIBUTING.rst

Lines changed: 5 additions & 5 deletions

_pytest/_argcomplete.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
which should throw a KeyError: 'COMPLINE' (which is properly set by the
5858
global argcomplete script).
5959
"""
60-
60+
from __future__ import absolute_import, division, print_function
6161
import sys
6262
import os
6363
from glob import glob

_pytest/_code/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
""" python inspection/code generation API """
2+
from __future__ import absolute_import, division, print_function
23
from .code import Code # noqa
34
from .code import ExceptionInfo # noqa
45
from .code import Frame # noqa

_pytest/_code/_py2traceback.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# CHANGES:
33
# - some_str is replaced, trying to create unicode strings
44
#
5+
from __future__ import absolute_import, division, print_function
56
import types
67

78
def format_exception_only(etype, value):

_pytest/_code/code.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from __future__ import absolute_import, division, print_function
12
import sys
23
from inspect import CO_VARARGS, CO_VARKEYWORDS
34
import re

_pytest/_code/source.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from __future__ import generators
1+
from __future__ import absolute_import, division, generators, print_function
22

33
from bisect import bisect_right
44
import sys

_pytest/_pluggy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
imports symbols from vendored "pluggy" if available, otherwise
33
falls back to importing "pluggy" from the default namespace.
44
"""
5-
5+
from __future__ import absolute_import, division, print_function
66
try:
77
from _pytest.vendored_packages.pluggy import * # noqa
88
from _pytest.vendored_packages.pluggy import __version__ # noqa

_pytest/assertion/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
support for presenting detailed information in failing assertions.
33
"""
4+
from __future__ import absolute_import, division, print_function
45
import py
56
import sys
67

_pytest/assertion/rewrite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""Rewrite assertion AST to produce nice error messages"""
2-
2+
from __future__ import absolute_import, division, print_function
33
import ast
44
import _ast
55
import errno

_pytest/assertion/truncate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Current default behaviour is to truncate assertion explanations at
55
~8 terminal lines, unless running in "-vv" mode or running on CI.
66
"""
7-
7+
from __future__ import absolute_import, division, print_function
88
import os
99

1010
import py

0 commit comments

Comments
 (0)