From fad3c4f8785cf185cdb4c9c769467c1e27784cf0 Mon Sep 17 00:00:00 2001 From: Pavel Minaev Date: Wed, 30 Oct 2019 14:09:58 -0700 Subject: [PATCH] Add "from __future__ import division" to all ptvsd modules. --- src/ptvsd/__init__.py | 2 +- src/ptvsd/__main__.py | 4 ++-- src/ptvsd/_vendored/__init__.py | 3 +-- src/ptvsd/_vendored/_pydevd_packaging.py | 2 +- src/ptvsd/_vendored/_util.py | 3 +-- src/ptvsd/_vendored/force_pydevd.py | 2 +- src/ptvsd/common/__init__.py | 2 +- src/ptvsd/common/compat.py | 2 +- src/ptvsd/common/fmt.py | 2 +- src/ptvsd/common/json.py | 2 +- src/ptvsd/common/log.py | 2 +- src/ptvsd/common/messaging.py | 2 +- src/ptvsd/common/options.py | 2 +- src/ptvsd/common/singleton.py | 2 +- src/ptvsd/common/sockets.py | 2 +- src/ptvsd/common/stacks.py | 2 +- src/ptvsd/common/timestamp.py | 2 +- src/ptvsd/common/util.py | 2 +- src/ptvsd/launcher/__init__.py | 4 ++-- src/ptvsd/server/__init__.py | 2 +- src/ptvsd/server/api.py | 2 +- src/ptvsd/server/attach_pid_injected.py | 2 +- src/ptvsd/server/cli.py | 4 ++-- src/ptvsd/server/options.py | 2 +- tests/DEBUGGEE_PYTHONPATH/debug_me/__init__.py | 2 +- tests/DEBUGGEE_PYTHONPATH/debug_me/backchannel.py | 2 +- tests/__init__.py | 2 +- tests/code.py | 2 +- tests/conftest.py | 2 +- tests/logs.py | 2 +- tests/net.py | 2 +- tests/patterns/__init__.py | 2 +- tests/patterns/_impl.py | 2 +- tests/patterns/dap.py | 2 +- tests/patterns/some.py | 2 +- tests/ptvsd/__init__.py | 2 +- tests/ptvsd/adapter/__init__.py | 2 +- tests/ptvsd/common/__init__.py | 2 +- tests/ptvsd/common/test_messaging.py | 2 +- tests/ptvsd/common/test_socket.py | 3 +++ tests/ptvsd/server/__init__.py | 2 +- tests/ptvsd/server/test_args.py | 2 +- tests/ptvsd/server/test_attach.py | 2 +- tests/ptvsd/server/test_breakpoints.py | 2 +- tests/ptvsd/server/test_completions.py | 2 +- tests/ptvsd/server/test_disconnect.py | 4 ++-- tests/ptvsd/server/test_django.py | 3 ++- tests/ptvsd/server/test_evaluate.py | 2 +- tests/ptvsd/server/test_exception.py | 2 +- tests/ptvsd/server/test_exclude_rules.py | 2 +- tests/ptvsd/server/test_flask.py | 2 +- tests/ptvsd/server/test_justmycode.py | 2 +- tests/ptvsd/server/test_log.py | 2 +- tests/ptvsd/server/test_multiproc.py | 2 +- tests/ptvsd/server/test_output.py | 2 +- tests/ptvsd/server/test_parse_args.py | 2 +- tests/ptvsd/server/test_path_mapping.py | 2 +- tests/ptvsd/server/test_run.py | 10 +++++----- tests/ptvsd/server/test_source_mapping.py | 3 +-- tests/ptvsd/server/test_start_stop.py | 2 +- tests/ptvsd/server/test_step.py | 2 +- tests/ptvsd/server/test_stop_on_entry.py | 2 +- tests/ptvsd/server/test_system_info.py | 2 +- tests/ptvsd/server/test_threads.py | 2 +- tests/ptvsd/server/test_tracing.py | 2 +- tests/ptvsd/server/test_vs_specific.py | 2 +- tests/ptvsd/test_docstrings.py | 2 +- tests/pytest_fixtures.py | 2 +- tests/pytest_hooks.py | 2 +- tests/tests/__init__.py | 2 +- tests/tests/test_patterns.py | 2 +- tests/tests/test_timeline.py | 2 +- tests/timeline.py | 2 +- tests/watchdog/__init__.py | 2 +- tests/watchdog/worker.py | 2 +- 75 files changed, 86 insertions(+), 85 deletions(-) diff --git a/src/ptvsd/__init__.py b/src/ptvsd/__init__.py index 6ac5bf25..dac9878c 100644 --- a/src/ptvsd/__init__.py +++ b/src/ptvsd/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals """An implementation of the Debug Adapter Protocol (DAP) for Python. diff --git a/src/ptvsd/__main__.py b/src/ptvsd/__main__.py index edc32d33..a2ed3e27 100644 --- a/src/ptvsd/__main__.py +++ b/src/ptvsd/__main__.py @@ -2,9 +2,9 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals -import os.path +import os import sys # Force absolute path on Python 2. diff --git a/src/ptvsd/_vendored/__init__.py b/src/ptvsd/_vendored/__init__.py index 4e4873bc..ee595f94 100644 --- a/src/ptvsd/_vendored/__init__.py +++ b/src/ptvsd/_vendored/__init__.py @@ -2,12 +2,11 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import contextlib from importlib import import_module import os -import os.path import sys from . import _util diff --git a/src/ptvsd/_vendored/_pydevd_packaging.py b/src/ptvsd/_vendored/_pydevd_packaging.py index 0728d98e..8ede7ba9 100644 --- a/src/ptvsd/_vendored/_pydevd_packaging.py +++ b/src/ptvsd/_vendored/_pydevd_packaging.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals from . import VENDORED_ROOT from ._util import cwd, iter_all_files diff --git a/src/ptvsd/_vendored/_util.py b/src/ptvsd/_vendored/_util.py index 117c0d92..1d7906f7 100644 --- a/src/ptvsd/_vendored/_util.py +++ b/src/ptvsd/_vendored/_util.py @@ -2,11 +2,10 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import contextlib import os -import os.path @contextlib.contextmanager diff --git a/src/ptvsd/_vendored/force_pydevd.py b/src/ptvsd/_vendored/force_pydevd.py index 64dbc770..c182a5ec 100644 --- a/src/ptvsd/_vendored/force_pydevd.py +++ b/src/ptvsd/_vendored/force_pydevd.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals from importlib import import_module import warnings diff --git a/src/ptvsd/common/__init__.py b/src/ptvsd/common/__init__.py index d1a64c66..2d77c303 100644 --- a/src/ptvsd/common/__init__.py +++ b/src/ptvsd/common/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals __all__ = [] diff --git a/src/ptvsd/common/compat.py b/src/ptvsd/common/compat.py index 7aaa91fd..ec0b61d2 100644 --- a/src/ptvsd/common/compat.py +++ b/src/ptvsd/common/compat.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals """Python 2/3 compatibility helpers. """ diff --git a/src/ptvsd/common/fmt.py b/src/ptvsd/common/fmt.py index 5cabafc8..71119caa 100644 --- a/src/ptvsd/common/fmt.py +++ b/src/ptvsd/common/fmt.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals """Provides a custom string.Formatter with JSON support. diff --git a/src/ptvsd/common/json.py b/src/ptvsd/common/json.py index 142d098a..2613610b 100644 --- a/src/ptvsd/common/json.py +++ b/src/ptvsd/common/json.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals """Improved JSON serialization. """ diff --git a/src/ptvsd/common/log.py b/src/ptvsd/common/log.py index 1023bb13..797b2db7 100644 --- a/src/ptvsd/common/log.py +++ b/src/ptvsd/common/log.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import contextlib import functools diff --git a/src/ptvsd/common/messaging.py b/src/ptvsd/common/messaging.py index f53b1f49..2a5bea99 100644 --- a/src/ptvsd/common/messaging.py +++ b/src/ptvsd/common/messaging.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals """An implementation of the session and presentation layers as used in the Debug Adapter Protocol (DAP): channels and their lifetime, JSON messages, requests, diff --git a/src/ptvsd/common/options.py b/src/ptvsd/common/options.py index 36cdd872..cef7cbe6 100644 --- a/src/ptvsd/common/options.py +++ b/src/ptvsd/common/options.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import os diff --git a/src/ptvsd/common/singleton.py b/src/ptvsd/common/singleton.py index 328758e5..72efdd9c 100644 --- a/src/ptvsd/common/singleton.py +++ b/src/ptvsd/common/singleton.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import functools import threading diff --git a/src/ptvsd/common/sockets.py b/src/ptvsd/common/sockets.py index 137e7944..8c27f67d 100644 --- a/src/ptvsd/common/sockets.py +++ b/src/ptvsd/common/sockets.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import platform import socket diff --git a/src/ptvsd/common/stacks.py b/src/ptvsd/common/stacks.py index 5c11f4f8..9da761f9 100644 --- a/src/ptvsd/common/stacks.py +++ b/src/ptvsd/common/stacks.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals """Provides facilities to dump all stacks of all threads in the process. """ diff --git a/src/ptvsd/common/timestamp.py b/src/ptvsd/common/timestamp.py index 2f017760..bfa67b05 100644 --- a/src/ptvsd/common/timestamp.py +++ b/src/ptvsd/common/timestamp.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals """Provides monotonic timestamps with a resetable zero. """ diff --git a/src/ptvsd/common/util.py b/src/ptvsd/common/util.py index 10f63d4e..69d20f7e 100644 --- a/src/ptvsd/common/util.py +++ b/src/ptvsd/common/util.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import os import sys diff --git a/src/ptvsd/launcher/__init__.py b/src/ptvsd/launcher/__init__.py index e055b585..2a6b5e3d 100644 --- a/src/ptvsd/launcher/__init__.py +++ b/src/ptvsd/launcher/__init__.py @@ -2,11 +2,11 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals __all__ = [] -import os.path +import os # Force absolute path on Python 2. __file__ = os.path.abspath(__file__) diff --git a/src/ptvsd/server/__init__.py b/src/ptvsd/server/__init__.py index c0cb7fa4..6439dfd8 100644 --- a/src/ptvsd/server/__init__.py +++ b/src/ptvsd/server/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals # "force_pydevd" must be imported first to ensure (via side effects) # that the ptvsd-vendored copy of pydevd gets used. diff --git a/src/ptvsd/server/api.py b/src/ptvsd/server/api.py index b74bfa03..944ef1c2 100644 --- a/src/ptvsd/server/api.py +++ b/src/ptvsd/server/api.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import contextlib import json diff --git a/src/ptvsd/server/attach_pid_injected.py b/src/ptvsd/server/attach_pid_injected.py index 4a6d1802..9ff1700d 100644 --- a/src/ptvsd/server/attach_pid_injected.py +++ b/src/ptvsd/server/attach_pid_injected.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import os diff --git a/src/ptvsd/server/cli.py b/src/ptvsd/server/cli.py index 2fbd24e4..38708038 100644 --- a/src/ptvsd/server/cli.py +++ b/src/ptvsd/server/cli.py @@ -2,9 +2,9 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals -import os.path +import os import runpy import sys diff --git a/src/ptvsd/server/options.py b/src/ptvsd/server/options.py index 2cba5db2..288a833d 100644 --- a/src/ptvsd/server/options.py +++ b/src/ptvsd/server/options.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals """ptvsd command-line options that need to be globally available. diff --git a/tests/DEBUGGEE_PYTHONPATH/debug_me/__init__.py b/tests/DEBUGGEE_PYTHONPATH/debug_me/__init__.py index 8282f575..c837d7ab 100644 --- a/tests/DEBUGGEE_PYTHONPATH/debug_me/__init__.py +++ b/tests/DEBUGGEE_PYTHONPATH/debug_me/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals """Makes sure that the code is run under debugger, using the appropriate method to establish connection back to DebugSession in the test process, depending on diff --git a/tests/DEBUGGEE_PYTHONPATH/debug_me/backchannel.py b/tests/DEBUGGEE_PYTHONPATH/debug_me/backchannel.py index e4c8c678..b372189c 100644 --- a/tests/DEBUGGEE_PYTHONPATH/debug_me/backchannel.py +++ b/tests/DEBUGGEE_PYTHONPATH/debug_me/backchannel.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals """Imported from test code that runs under ptvsd, and allows that code to communcate back to the test. Works in conjunction with debug_session diff --git a/tests/__init__.py b/tests/__init__.py index a27b705a..5ea517ad 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals """ptvsd tests """ diff --git a/tests/code.py b/tests/code.py index 86a0ed6a..ae11aab9 100644 --- a/tests/code.py +++ b/tests/code.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals """Helpers to work with Python code. """ diff --git a/tests/conftest.py b/tests/conftest.py index d219813b..4d144276 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals """pytest configuration. """ diff --git a/tests/logs.py b/tests/logs.py index b3a9662a..24c9e210 100644 --- a/tests/logs.py +++ b/tests/logs.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import io import os diff --git a/tests/net.py b/tests/net.py index c1f495c9..83107f8d 100644 --- a/tests/net.py +++ b/tests/net.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals """Test helpers for networking. """ diff --git a/tests/patterns/__init__.py b/tests/patterns/__init__.py index 8c692300..9c097be8 100644 --- a/tests/patterns/__init__.py +++ b/tests/patterns/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals """Do not import this package directly - import tests.patterns.some instead. """ diff --git a/tests/patterns/_impl.py b/tests/patterns/_impl.py index 936a8e76..9a7e3071 100644 --- a/tests/patterns/_impl.py +++ b/tests/patterns/_impl.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals # The actual patterns are defined here, so that tests.patterns.some can redefine # builtin names like str, int etc without affecting the implementations in this diff --git a/tests/patterns/dap.py b/tests/patterns/dap.py index 92e4cf54..ea302403 100644 --- a/tests/patterns/dap.py +++ b/tests/patterns/dap.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals """Patterns that are specific to the Debug Adapter Protocol. """ diff --git a/tests/patterns/some.py b/tests/patterns/some.py index d1b1ca46..67f3a35b 100644 --- a/tests/patterns/some.py +++ b/tests/patterns/some.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals """Pattern matching for recursive Python data structures. diff --git a/tests/ptvsd/__init__.py b/tests/ptvsd/__init__.py index f87c379c..86166ae9 100644 --- a/tests/ptvsd/__init__.py +++ b/tests/ptvsd/__init__.py @@ -2,6 +2,6 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals """Product tests.""" diff --git a/tests/ptvsd/adapter/__init__.py b/tests/ptvsd/adapter/__init__.py index 059014ca..58903273 100644 --- a/tests/ptvsd/adapter/__init__.py +++ b/tests/ptvsd/adapter/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals """Tests for the debug adapter. """ diff --git a/tests/ptvsd/common/__init__.py b/tests/ptvsd/common/__init__.py index c5bd0ff7..d2a95d30 100644 --- a/tests/ptvsd/common/__init__.py +++ b/tests/ptvsd/common/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals """Tests for product code that is shared between the adapter and the server. """ diff --git a/tests/ptvsd/common/test_messaging.py b/tests/ptvsd/common/test_messaging.py index 8cef0970..3ab4436a 100644 --- a/tests/ptvsd/common/test_messaging.py +++ b/tests/ptvsd/common/test_messaging.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals """Tests for JSON message streams and channels. """ diff --git a/tests/ptvsd/common/test_socket.py b/tests/ptvsd/common/test_socket.py index a752bfb7..f490be21 100644 --- a/tests/ptvsd/common/test_socket.py +++ b/tests/ptvsd/common/test_socket.py @@ -2,8 +2,11 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. +from __future__ import absolute_import, division, print_function, unicode_literals + import platform import pytest + from ptvsd.common import sockets diff --git a/tests/ptvsd/server/__init__.py b/tests/ptvsd/server/__init__.py index c395291e..c9cc9f31 100644 --- a/tests/ptvsd/server/__init__.py +++ b/tests/ptvsd/server/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals """Tests for the debug server. """ diff --git a/tests/ptvsd/server/test_args.py b/tests/ptvsd/server/test_args.py index 46ab4c56..4b72e5fd 100644 --- a/tests/ptvsd/server/test_args.py +++ b/tests/ptvsd/server/test_args.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import pytest diff --git a/tests/ptvsd/server/test_attach.py b/tests/ptvsd/server/test_attach.py index 41b37ff0..a9b22634 100644 --- a/tests/ptvsd/server/test_attach.py +++ b/tests/ptvsd/server/test_attach.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import pytest diff --git a/tests/ptvsd/server/test_breakpoints.py b/tests/ptvsd/server/test_breakpoints.py index 9a6de03c..e8c1145f 100644 --- a/tests/ptvsd/server/test_breakpoints.py +++ b/tests/ptvsd/server/test_breakpoints.py @@ -3,7 +3,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import platform import pytest diff --git a/tests/ptvsd/server/test_completions.py b/tests/ptvsd/server/test_completions.py index aa990e9c..9acefab5 100644 --- a/tests/ptvsd/server/test_completions.py +++ b/tests/ptvsd/server/test_completions.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import pytest diff --git a/tests/ptvsd/server/test_disconnect.py b/tests/ptvsd/server/test_disconnect.py index 11ed9c8f..d9e24116 100644 --- a/tests/ptvsd/server/test_disconnect.py +++ b/tests/ptvsd/server/test_disconnect.py @@ -2,9 +2,9 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals -import os.path +import os import pytest from tests import debug diff --git a/tests/ptvsd/server/test_django.py b/tests/ptvsd/server/test_django.py index b1237e07..91af5aef 100644 --- a/tests/ptvsd/server/test_django.py +++ b/tests/ptvsd/server/test_django.py @@ -2,9 +2,10 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import pytest + from ptvsd.common import compat from tests import code, debug, log, net, test_data from tests.debug import runners, targets diff --git a/tests/ptvsd/server/test_evaluate.py b/tests/ptvsd/server/test_evaluate.py index 7a99a1de..db7cc801 100644 --- a/tests/ptvsd/server/test_evaluate.py +++ b/tests/ptvsd/server/test_evaluate.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import pytest import sys diff --git a/tests/ptvsd/server/test_exception.py b/tests/ptvsd/server/test_exception.py index f7d132d9..0d0b78b4 100644 --- a/tests/ptvsd/server/test_exception.py +++ b/tests/ptvsd/server/test_exception.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import pytest diff --git a/tests/ptvsd/server/test_exclude_rules.py b/tests/ptvsd/server/test_exclude_rules.py index 02218cf0..09b9b31d 100644 --- a/tests/ptvsd/server/test_exclude_rules.py +++ b/tests/ptvsd/server/test_exclude_rules.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import pytest diff --git a/tests/ptvsd/server/test_flask.py b/tests/ptvsd/server/test_flask.py index 8a161d13..bab2b497 100644 --- a/tests/ptvsd/server/test_flask.py +++ b/tests/ptvsd/server/test_flask.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import platform import pytest diff --git a/tests/ptvsd/server/test_justmycode.py b/tests/ptvsd/server/test_justmycode.py index 7427c989..dca1dfd1 100644 --- a/tests/ptvsd/server/test_justmycode.py +++ b/tests/ptvsd/server/test_justmycode.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import pytest diff --git a/tests/ptvsd/server/test_log.py b/tests/ptvsd/server/test_log.py index 2340e83e..f84154a3 100644 --- a/tests/ptvsd/server/test_log.py +++ b/tests/ptvsd/server/test_log.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import contextlib import pytest diff --git a/tests/ptvsd/server/test_multiproc.py b/tests/ptvsd/server/test_multiproc.py index 2bb7905a..dca8940d 100644 --- a/tests/ptvsd/server/test_multiproc.py +++ b/tests/ptvsd/server/test_multiproc.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import platform import pytest diff --git a/tests/ptvsd/server/test_output.py b/tests/ptvsd/server/test_output.py index 1a88ecb9..bd25c9cc 100644 --- a/tests/ptvsd/server/test_output.py +++ b/tests/ptvsd/server/test_output.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import pytest diff --git a/tests/ptvsd/server/test_parse_args.py b/tests/ptvsd/server/test_parse_args.py index 8152a3dd..f16c6a7d 100644 --- a/tests/ptvsd/server/test_parse_args.py +++ b/tests/ptvsd/server/test_parse_args.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import pytest diff --git a/tests/ptvsd/server/test_path_mapping.py b/tests/ptvsd/server/test_path_mapping.py index edf6ba50..021ea4db 100644 --- a/tests/ptvsd/server/test_path_mapping.py +++ b/tests/ptvsd/server/test_path_mapping.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import pytest diff --git a/tests/ptvsd/server/test_run.py b/tests/ptvsd/server/test_run.py index 0631d8c7..50f74786 100644 --- a/tests/ptvsd/server/test_run.py +++ b/tests/ptvsd/server/test_run.py @@ -2,9 +2,9 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals -from os import path +import os import pytest import re @@ -21,11 +21,11 @@ def test_run(pyfile, target, run): @pyfile def code_to_debug(): from debug_me import backchannel - from os import path + import os import sys print("begin") - backchannel.send(path.abspath(sys.modules["ptvsd"].__file__)) + backchannel.send(os.path.abspath(sys.modules["ptvsd"].__file__)) assert backchannel.receive() == "continue" print("end") @@ -34,7 +34,7 @@ def test_run(pyfile, target, run): with run(session, target(code_to_debug)): pass - expected_ptvsd_path = path.abspath(ptvsd.__file__) + expected_ptvsd_path = os.path.abspath(ptvsd.__file__) assert backchannel.receive() == some.str.matching( re.escape(expected_ptvsd_path) + r"(c|o)?" ) diff --git a/tests/ptvsd/server/test_source_mapping.py b/tests/ptvsd/server/test_source_mapping.py index a5346652..eabbec27 100644 --- a/tests/ptvsd/server/test_source_mapping.py +++ b/tests/ptvsd/server/test_source_mapping.py @@ -2,8 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals - +from __future__ import absolute_import, division, print_function, unicode_literals import sys from tests import debug diff --git a/tests/ptvsd/server/test_start_stop.py b/tests/ptvsd/server/test_start_stop.py index f9f777c7..9e51ae9a 100644 --- a/tests/ptvsd/server/test_start_stop.py +++ b/tests/ptvsd/server/test_start_stop.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import pytest import sys diff --git a/tests/ptvsd/server/test_step.py b/tests/ptvsd/server/test_step.py index 62c34583..64d03112 100644 --- a/tests/ptvsd/server/test_step.py +++ b/tests/ptvsd/server/test_step.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import pytest diff --git a/tests/ptvsd/server/test_stop_on_entry.py b/tests/ptvsd/server/test_stop_on_entry.py index 2b8bd988..54b3f4b5 100644 --- a/tests/ptvsd/server/test_stop_on_entry.py +++ b/tests/ptvsd/server/test_stop_on_entry.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import pytest diff --git a/tests/ptvsd/server/test_system_info.py b/tests/ptvsd/server/test_system_info.py index 80118a92..9d39774c 100644 --- a/tests/ptvsd/server/test_system_info.py +++ b/tests/ptvsd/server/test_system_info.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import pytest import sys diff --git a/tests/ptvsd/server/test_threads.py b/tests/ptvsd/server/test_threads.py index 27f2f221..4798bc48 100644 --- a/tests/ptvsd/server/test_threads.py +++ b/tests/ptvsd/server/test_threads.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import platform import pytest diff --git a/tests/ptvsd/server/test_tracing.py b/tests/ptvsd/server/test_tracing.py index bc56c3de..109db114 100644 --- a/tests/ptvsd/server/test_tracing.py +++ b/tests/ptvsd/server/test_tracing.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals from tests import debug from tests.patterns import some diff --git a/tests/ptvsd/server/test_vs_specific.py b/tests/ptvsd/server/test_vs_specific.py index 243d1dc4..e39b404a 100644 --- a/tests/ptvsd/server/test_vs_specific.py +++ b/tests/ptvsd/server/test_vs_specific.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import pytest diff --git a/tests/ptvsd/test_docstrings.py b/tests/ptvsd/test_docstrings.py index 762d3b8d..e9ed6387 100644 --- a/tests/ptvsd/test_docstrings.py +++ b/tests/ptvsd/test_docstrings.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import inspect diff --git a/tests/pytest_fixtures.py b/tests/pytest_fixtures.py index 417914b1..5bc47887 100644 --- a/tests/pytest_fixtures.py +++ b/tests/pytest_fixtures.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import inspect import os diff --git a/tests/pytest_hooks.py b/tests/pytest_hooks.py index 3684c2e9..3a80354f 100644 --- a/tests/pytest_hooks.py +++ b/tests/pytest_hooks.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import os import pytest diff --git a/tests/tests/__init__.py b/tests/tests/__init__.py index 340e19cc..243f28a1 100644 --- a/tests/tests/__init__.py +++ b/tests/tests/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals """Tests for the testing infrastructure. """ diff --git a/tests/tests/test_patterns.py b/tests/tests/test_patterns.py index fd6c4794..09e95817 100644 --- a/tests/tests/test_patterns.py +++ b/tests/tests/test_patterns.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import pytest import sys diff --git a/tests/tests/test_timeline.py b/tests/tests/test_timeline.py index b5494867..5698e0aa 100644 --- a/tests/tests/test_timeline.py +++ b/tests/tests/test_timeline.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import collections import functools diff --git a/tests/timeline.py b/tests/timeline.py index e907c645..fa3b6e31 100644 --- a/tests/timeline.py +++ b/tests/timeline.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals import collections import contextlib diff --git a/tests/watchdog/__init__.py b/tests/watchdog/__init__.py index 50cf1c59..1c550d5a 100644 --- a/tests/watchdog/__init__.py +++ b/tests/watchdog/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals """A watchdog process for debuggee processes spawned by tests. diff --git a/tests/watchdog/worker.py b/tests/watchdog/worker.py index 68a7329b..a8d3077e 100644 --- a/tests/watchdog/worker.py +++ b/tests/watchdog/worker.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. See LICENSE in the project root # for license information. -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import, division, print_function, unicode_literals """The main script for the watchdog worker process. """