diff --git a/.eslintignore b/.eslintignore index 7f6bb48d6c8e..9399ff461dcd 100644 --- a/.eslintignore +++ b/.eslintignore @@ -105,7 +105,7 @@ src/test/common/process/proc.unit.test.ts src/test/common/interpreterPathService.unit.test.ts -src/test/pythonFiles/formatting/dummy.ts +src/test/python_files/formatting/dummy.ts src/test/debugger/extension/adapter/adapter.test.ts src/test/debugger/extension/adapter/outdatedDebuggerPrompt.unit.test.ts diff --git a/.github/actions/build-vsix/action.yml b/.github/actions/build-vsix/action.yml index 52d6d1cdbdd4..5b8a569889a8 100644 --- a/.github/actions/build-vsix/action.yml +++ b/.github/actions/build-vsix/action.yml @@ -30,7 +30,7 @@ runs: cache-dependency-path: | requirements.txt build/build-install-requirements.txt - pythonFiles/jedilsp_requirements/requirements.txt + python_files/jedilsp_requirements/requirements.txt - name: Upgrade Pip run: python -m pip install -U pip @@ -44,20 +44,20 @@ runs: - name: Install Python dependencies uses: brettcannon/pip-secure-install@v1 with: - options: '-t ./pythonFiles/lib/python --implementation py' + options: '-t ./python_files/lib/python --implementation py' - name: Install debugpy and get-pip run: | python -m pip --disable-pip-version-check install packaging - python ./pythonFiles/install_debugpy.py - python ./pythonFiles/download_get_pip.py + python ./python_files/install_debugpy.py + python ./python_files/download_get_pip.py shell: bash - name: Install Jedi LSP uses: brettcannon/pip-secure-install@v1 with: - requirements-file: './pythonFiles/jedilsp_requirements/requirements.txt' - options: '-t ./pythonFiles/lib/jedilsp --implementation py --platform any --abi none' + requirements-file: './python_files/jedilsp_requirements/requirements.txt' + options: '-t ./python_files/lib/jedilsp --implementation py --platform any --abi none' - name: Run npm ci run: npm ci --prefer-offline diff --git a/.github/actions/lint/action.yml b/.github/actions/lint/action.yml index 47924c108151..ed0e380bed6e 100644 --- a/.github/actions/lint/action.yml +++ b/.github/actions/lint/action.yml @@ -45,12 +45,12 @@ runs: run: | python -m pip install -U black python -m black . --check - working-directory: pythonFiles + working-directory: python_files shell: bash - name: Run Ruff run: | python -m pip install -U ruff python -m ruff check . - working-directory: pythonFiles + working-directory: python_files shell: bash diff --git a/.github/actions/smoke-tests/action.yml b/.github/actions/smoke-tests/action.yml index b2d002050433..7eaa2483942a 100644 --- a/.github/actions/smoke-tests/action.yml +++ b/.github/actions/smoke-tests/action.yml @@ -34,12 +34,12 @@ runs: - name: Install Python requirements uses: brettcannon/pip-secure-install@v1 with: - options: '-t ./pythonFiles/lib/python --implementation py' + options: '-t ./python_files/lib/python --implementation py' - name: pip install system test requirements run: | python -m pip install --upgrade -r build/test-requirements.txt - python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --implementation py --no-deps --upgrade --pre debugpy + python -m pip --disable-pip-version-check install -t ./python_files/lib/python --implementation py --no-deps --upgrade --pre debugpy shell: bash # Bits from the VSIX are reused by smokeTest.ts to speed things up. diff --git a/.github/release_plan.md b/.github/release_plan.md index f1d95d8577d0..8c7e1e660d36 100644 --- a/.github/release_plan.md +++ b/.github/release_plan.md @@ -37,7 +37,7 @@ NOTE: the number of this release is in the issue title and can be substituted in - [ ] Create a new branch called **`bump-release-[YYYY.minor]`**. - [ ] Change the version in `package.json` to the next **even** number and switch the `-dev` to `-rc`. (🤖) - [ ] Run `npm install` to make sure `package-lock.json` is up-to-date _(you should now see changes to the `package.json` and `package-lock.json` at this point which update the version number **only**)_. (🤖) -- [ ] Check [debugpy on PyPI](https://pypi.org/project/debugpy/) for a new release and update the version of debugpy in [`install_debugpy.py`](https://github.com/microsoft/vscode-python/blob/main/pythonFiles/install_debugpy.py) if necessary. +- [ ] Check [debugpy on PyPI](https://pypi.org/project/debugpy/) for a new release and update the version of debugpy in [`install_debugpy.py`](https://github.com/microsoft/vscode-python/blob/main/python_files/install_debugpy.py) if necessary. - [ ] Update `ThirdPartyNotices-Repository.txt` as appropriate. You can check by looking at the [commit history](https://github.com/microsoft/vscode-python/commits/main) and scrolling through to see if there's anything listed there which might have pulled in some code directly into the repository from somewhere else. If you are still unsure you can check with the team. - [ ] Create a PR from your branch **`bump-release-[YYYY.minor]`** to `main`. Add the `"no change-log"` tag to the PR so it does not show up on the release notes before merging it. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3de5bd1ff756..1791e9797fa7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -87,24 +87,24 @@ jobs: - name: Install core Python requirements uses: brettcannon/pip-secure-install@v1 with: - options: '-t ./pythonFiles/lib/python --no-cache-dir --implementation py' + options: '-t ./python_files/lib/python --no-cache-dir --implementation py' - name: Install Jedi requirements uses: brettcannon/pip-secure-install@v1 with: - requirements-file: './pythonFiles/jedilsp_requirements/requirements.txt' - options: '-t ./pythonFiles/lib/jedilsp --no-cache-dir --implementation py' + requirements-file: './python_files/jedilsp_requirements/requirements.txt' + options: '-t ./python_files/lib/jedilsp --no-cache-dir --implementation py' - name: Install other Python requirements run: | - python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy + python -m pip --disable-pip-version-check install -t ./python_files/lib/python --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy python -m pip install --upgrade -r build/test-requirements.txt - name: Run Pyright uses: jakebailey/pyright-action@v2 with: version: 1.1.308 - working-directory: 'pythonFiles' + working-directory: 'python_files' python-tests: name: Python Tests @@ -137,13 +137,13 @@ jobs: uses: brettcannon/pip-secure-install@v1 with: requirements-file: '"${{ env.special-working-directory-relative }}/requirements.txt"' - options: '-t "${{ env.special-working-directory-relative }}/pythonFiles/lib/python" --no-cache-dir --implementation py' + options: '-t "${{ env.special-working-directory-relative }}/python_files/lib/python" --no-cache-dir --implementation py' - name: Install test requirements run: python -m pip install --upgrade -r build/test-requirements.txt - name: Run Python unit tests - run: python pythonFiles/tests/run_all.py + run: python python_files/tests/run_all.py tests: name: Tests @@ -192,26 +192,26 @@ jobs: run: | python -m pip install wheel python -m pip install -r build/build-install-requirements.txt - python ./pythonFiles/download_get_pip.py + python ./python_files/download_get_pip.py shell: bash - name: Install debugpy run: | # We need to have debugpy so that tests relying on it keep passing, but we don't need install_debugpy's logic in the test phase. - python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy + python -m pip --disable-pip-version-check install -t ./python_files/lib/python --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy - name: Install core Python requirements uses: brettcannon/pip-secure-install@v1 with: requirements-file: '"${{ env.special-working-directory-relative }}/requirements.txt"' - options: '-t "${{ env.special-working-directory-relative }}/pythonFiles/lib/python" --no-cache-dir --implementation py' + options: '-t "${{ env.special-working-directory-relative }}/python_files/lib/python" --no-cache-dir --implementation py' if: startsWith(matrix.python, 3.) - name: Install Jedi requirements uses: brettcannon/pip-secure-install@v1 with: - requirements-file: '"${{ env.special-working-directory-relative }}/pythonFiles/jedilsp_requirements/requirements.txt"' - options: '-t "${{ env.special-working-directory-relative }}/pythonFiles/lib/jedilsp" --no-cache-dir --implementation py' + requirements-file: '"${{ env.special-working-directory-relative }}/python_files/jedilsp_requirements/requirements.txt"' + options: '-t "${{ env.special-working-directory-relative }}/python_files/lib/jedilsp" --no-cache-dir --implementation py' if: startsWith(matrix.python, 3.) - name: Install test requirements @@ -221,7 +221,7 @@ jobs: run: | python -m pip install wheel python -m pip install -r build/build-install-requirements.txt - python ./pythonFiles/install_debugpy.py + python ./python_files/install_debugpy.py shell: bash if: matrix.test-suite == 'debugger' diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 5ec7027c74e5..46c061d3cc1c 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -61,24 +61,24 @@ jobs: - name: Install base Python requirements uses: brettcannon/pip-secure-install@v1 with: - options: '-t ./pythonFiles/lib/python --no-cache-dir --implementation py' + options: '-t ./python_files/lib/python --no-cache-dir --implementation py' - name: Install Jedi requirements uses: brettcannon/pip-secure-install@v1 with: - requirements-file: './pythonFiles/jedilsp_requirements/requirements.txt' - options: '-t ./pythonFiles/lib/jedilsp --no-cache-dir --implementation py' + requirements-file: './python_files/jedilsp_requirements/requirements.txt' + options: '-t ./python_files/lib/jedilsp --no-cache-dir --implementation py' - name: Install other Python requirements run: | - python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy + python -m pip --disable-pip-version-check install -t ./python_files/lib/python --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy python -m pip install --upgrade -r build/test-requirements.txt - name: Run Pyright uses: jakebailey/pyright-action@v2 with: version: 1.1.308 - working-directory: 'pythonFiles' + working-directory: 'python_files' python-tests: name: Python Tests @@ -124,13 +124,13 @@ jobs: uses: brettcannon/pip-secure-install@v1 with: requirements-file: '"${{ env.special-working-directory-relative }}/requirements.txt"' - options: '-t "${{ env.special-working-directory-relative }}/pythonFiles/lib/python" --no-cache-dir --implementation py' + options: '-t "${{ env.special-working-directory-relative }}/python_files/lib/python" --no-cache-dir --implementation py' - name: Install test requirements run: python -m pip install --upgrade -r build/test-requirements.txt - name: Run Python unit tests - run: python pythonFiles/tests/run_all.py + run: python python_files/tests/run_all.py tests: name: Tests @@ -179,26 +179,26 @@ jobs: - name: Install debugpy run: | # We need to have debugpy so that tests relying on it keep passing, but we don't need install_debugpy's logic in the test phase. - python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy + python -m pip --disable-pip-version-check install -t ./python_files/lib/python --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy - name: Download get-pip.py run: | python -m pip install wheel python -m pip install -r build/build-install-requirements.txt - python ./pythonFiles/download_get_pip.py + python ./python_files/download_get_pip.py shell: bash - name: Install base Python requirements uses: brettcannon/pip-secure-install@v1 with: requirements-file: '"${{ env.special-working-directory-relative }}/requirements.txt"' - options: '-t "${{ env.special-working-directory-relative }}/pythonFiles/lib/python" --no-cache-dir --implementation py' + options: '-t "${{ env.special-working-directory-relative }}/python_files/lib/python" --no-cache-dir --implementation py' - name: Install Jedi requirements uses: brettcannon/pip-secure-install@v1 with: - requirements-file: '"${{ env.special-working-directory-relative }}/pythonFiles/jedilsp_requirements/requirements.txt"' - options: '-t "${{ env.special-working-directory-relative }}/pythonFiles/lib/jedilsp" --no-cache-dir --implementation py' + requirements-file: '"${{ env.special-working-directory-relative }}/python_files/jedilsp_requirements/requirements.txt"' + options: '-t "${{ env.special-working-directory-relative }}/python_files/lib/jedilsp" --no-cache-dir --implementation py' - name: Install test requirements run: python -m pip install --upgrade -r build/test-requirements.txt @@ -207,7 +207,7 @@ jobs: run: | python -m pip install wheel python -m pip --disable-pip-version-check install -r build/build-install-requirements.txt - python ./pythonFiles/install_debugpy.py + python ./python_files/install_debugpy.py shell: bash if: matrix.test-suite == 'debugger' @@ -393,25 +393,25 @@ jobs: cache: 'pip' cache-dependency-path: | requirements.txt - pythonFiles/jedilsp_requirements/requirements.txt + python_files/jedilsp_requirements/requirements.txt build/test-requirements.txt build/functional-test-requirements.txt - name: Install base Python requirements uses: brettcannon/pip-secure-install@v1 with: - options: '-t ./pythonFiles/lib/python --implementation py' + options: '-t ./python_files/lib/python --implementation py' - name: Install Jedi requirements uses: brettcannon/pip-secure-install@v1 with: - requirements-file: './pythonFiles/jedilsp_requirements/requirements.txt' - options: '-t ./pythonFiles/lib/jedilsp --implementation py' + requirements-file: './python_files/jedilsp_requirements/requirements.txt' + options: '-t ./python_files/lib/jedilsp --implementation py' - name: Install debugpy run: | # We need to have debugpy so that tests relying on it keep passing, but we don't need install_debugpy's logic in the test phase. - python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --implementation py --no-deps --upgrade --pre debugpy + python -m pip --disable-pip-version-check install -t ./python_files/lib/python --implementation py --no-deps --upgrade --pre debugpy - name: Install test requirements run: python -m pip install --upgrade -r build/test-requirements.txt @@ -487,7 +487,7 @@ jobs: - name: Run Python unit tests run: | - python pythonFiles/tests/run_all.py + python python_files/tests/run_all.py # The virtual environment based tests use the `testSingleWorkspace` set of tests # with the environment variable `TEST_FILES_SUFFIX` set to `testvirtualenvs`, diff --git a/.gitignore b/.gitignore index 69166ccac1a4..0556cbb2df0e 100644 --- a/.gitignore +++ b/.gitignore @@ -23,8 +23,8 @@ cucumber-report.json **/.venv*/ port.txt precommit.hook -pythonFiles/lib/** -pythonFiles/get-pip.py +python_files/lib/** +python_files/get-pip.py debug_coverage*/** languageServer/** languageServer.*/** diff --git a/.vscode/launch.json b/.vscode/launch.json index 82981a93305d..152ef1c87f60 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -249,7 +249,7 @@ }, { "name": "Listen", - "type": "python", + "type": "debugpy", "request": "attach", "listen": { "host": "localhost", "port": 5678 }, "justMyCode": true @@ -257,10 +257,10 @@ { "name": "Debug pytest plugin tests", - "type": "python", + "type": "debugpy", "request": "launch", "module": "pytest", - "args": ["${workspaceFolder}/pythonFiles/tests/pytestadapter"], + "args": ["${workspaceFolder}/python_files/tests/pytestadapter"], "justMyCode": true } ], diff --git a/.vscode/settings.json b/.vscode/settings.json index 50864f0b5cd8..5e5954991562 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -64,7 +64,7 @@ // Open merge editor for resolving conflicts. "git.mergeEditor": true, "python.testing.pytestArgs": [ - "pythonFiles/tests" + "python_files/tests" ], "python.testing.unittestEnabled": false, "python.testing.pytestEnabled": true diff --git a/.vscodeignore b/.vscodeignore index 6788f9b6d8e1..9d1934545bf1 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -51,16 +51,16 @@ obj/** out/**/*.stats.json out/client/**/*.analyzer.html out/coverconfig.json -out/pythonFiles/** +out/python_files/** out/src/** out/test/** out/testMultiRootWkspc/** precommit.hook -pythonFiles/**/*.pyc -pythonFiles/lib/**/*.egg-info/** -pythonFiles/lib/python/bin/** -pythonFiles/jedilsp_requirements/** -pythonFiles/tests/** +python_files/**/*.pyc +python_files/lib/**/*.egg-info/** +python_files/lib/python/bin/** +python_files/jedilsp_requirements/** +python_files/tests/** scripts/** src/** test/** diff --git a/build/azure-pipeline.pre-release.yml b/build/azure-pipeline.pre-release.yml index bb52f983d02e..5f66ae71cfec 100644 --- a/build/azure-pipeline.pre-release.yml +++ b/build/azure-pipeline.pre-release.yml @@ -54,16 +54,16 @@ extends: - script: | python -m pip --disable-pip-version-check install -r build/build-install-requirements.txt - python ./pythonFiles/install_debugpy.py - python ./pythonFiles/download_get_pip.py + python ./python_files/install_debugpy.py + python ./python_files/download_get_pip.py displayName: Install debugpy and get-pip.py - script: | - python -m pip install --no-deps --require-hashes --only-binary :all: -t ./pythonFiles/lib/python --implementation py -r ./requirements.txt + python -m pip install --no-deps --require-hashes --only-binary :all: -t ./python_files/lib/python --implementation py -r ./requirements.txt displayName: Install Python dependencies - script: | - python -m pip install --no-deps --require-hashes --only-binary :all: -t ./pythonFiles/lib/jedilsp --implementation py --platform any --abi none -r ./pythonFiles/jedilsp_requirements/requirements.txt + python -m pip install --no-deps --require-hashes --only-binary :all: -t ./python_files/lib/jedilsp --implementation py --platform any --abi none -r ./python_files/jedilsp_requirements/requirements.txt displayName: Install Jedi Language Server - script: | diff --git a/build/azure-pipeline.stable.yml b/build/azure-pipeline.stable.yml index 8d04ebab318a..2aeafbc1e0df 100644 --- a/build/azure-pipeline.stable.yml +++ b/build/azure-pipeline.stable.yml @@ -49,16 +49,16 @@ extends: - script: | python -m pip --disable-pip-version-check install -r build/build-install-requirements.txt - python ./pythonFiles/install_debugpy.py - python ./pythonFiles/download_get_pip.py + python ./python_files/install_debugpy.py + python ./python_files/download_get_pip.py displayName: Install debugpy and get-pip.py - script: | - python -m pip install --no-deps --require-hashes --only-binary :all: -t ./pythonFiles/lib/python --implementation py -r ./requirements.txt + python -m pip install --no-deps --require-hashes --only-binary :all: -t ./python_files/lib/python --implementation py -r ./requirements.txt displayName: Install Python dependencies - script: | - python -m pip install --no-deps --require-hashes --only-binary :all: -t ./pythonFiles/lib/jedilsp --implementation py --platform any --abi none -r ./pythonFiles/jedilsp_requirements/requirements.txt + python -m pip install --no-deps --require-hashes --only-binary :all: -t ./python_files/lib/jedilsp --implementation py --platform any --abi none -r ./python_files/jedilsp_requirements/requirements.txt displayName: Install Jedi Language Server - script: | diff --git a/build/existingFiles.json b/build/existingFiles.json index 1f5acc727d8e..48ab84ff565d 100644 --- a/build/existingFiles.json +++ b/build/existingFiles.json @@ -500,7 +500,7 @@ "src/test/providers/shebangCodeLenseProvider.test.ts", "src/test/providers/symbolProvider.unit.test.ts", "src/test/providers/terminal.unit.test.ts", - "src/test/pythonFiles/formatting/dummy.ts", + "src/test/python_files/formatting/dummy.ts", "src/test/refactor/extension.refactor.extract.method.test.ts", "src/test/refactor/extension.refactor.extract.var.test.ts", "src/test/refactor/rename.test.ts", diff --git a/noxfile.py b/noxfile.py index b9ebba64544a..aa6d0253c660 100644 --- a/noxfile.py +++ b/noxfile.py @@ -9,10 +9,10 @@ @nox.session() def install_python_libs(session: nox.Session): requirements = [ - ("./pythonFiles/lib/python", "./requirements.txt"), + ("./python_files/lib/python", "./requirements.txt"), ( - "./pythonFiles/lib/jedilsp", - "./pythonFiles/jedilsp_requirements/requirements.txt", + "./python_files/lib/jedilsp", + "./python_files/jedilsp_requirements/requirements.txt", ), ] for target, file in requirements: @@ -35,16 +35,16 @@ def install_python_libs(session: nox.Session): # Install debugger session.run( "python", - "./pythonFiles/install_debugpy.py", - env={"PYTHONPATH": "./pythonFiles/lib/temp"}, + "./python_files/install_debugpy.py", + env={"PYTHONPATH": "./python_files/lib/temp"}, ) # Download get-pip script session.run( "python", - "./pythonFiles/download_get_pip.py", - env={"PYTHONPATH": "./pythonFiles/lib/temp"}, + "./python_files/download_get_pip.py", + env={"PYTHONPATH": "./python_files/lib/temp"}, ) - if pathlib.Path("./pythonFiles/lib/temp").exists(): - shutil.rmtree("./pythonFiles/lib/temp") + if pathlib.Path("./python_files/lib/temp").exists(): + shutil.rmtree("./python_files/lib/temp") diff --git a/pythonExtensionApi/src/main.ts b/pythonExtensionApi/src/main.ts index 4de554bf5a24..dccbd78f6f04 100644 --- a/pythonExtensionApi/src/main.ts +++ b/pythonExtensionApi/src/main.ts @@ -16,7 +16,7 @@ export interface PythonExtension { /** * Generate an array of strings for commands to pass to the Python executable to launch the debugger for remote debugging. * Users can append another array of strings of what they want to execute along with relevant arguments to Python. - * E.g `['/Users/..../pythonVSCode/pythonFiles/lib/python/debugpy', '--listen', 'localhost:57039', '--wait-for-client']` + * E.g `['/Users/..../pythonVSCode/python_files/lib/python/debugpy', '--listen', 'localhost:57039', '--wait-for-client']` * @param host * @param port * @param waitUntilDebuggerAttaches Defaults to `true`. diff --git a/pythonFiles/.env b/python_files/.env similarity index 100% rename from pythonFiles/.env rename to python_files/.env diff --git a/pythonFiles/.vscode/settings.json b/python_files/.vscode/settings.json similarity index 100% rename from pythonFiles/.vscode/settings.json rename to python_files/.vscode/settings.json diff --git a/pythonFiles/Notebooks intro.ipynb b/python_files/Notebooks intro.ipynb similarity index 100% rename from pythonFiles/Notebooks intro.ipynb rename to python_files/Notebooks intro.ipynb diff --git a/pythonFiles/create_conda.py b/python_files/create_conda.py similarity index 100% rename from pythonFiles/create_conda.py rename to python_files/create_conda.py diff --git a/pythonFiles/create_microvenv.py b/python_files/create_microvenv.py similarity index 100% rename from pythonFiles/create_microvenv.py rename to python_files/create_microvenv.py diff --git a/pythonFiles/create_venv.py b/python_files/create_venv.py similarity index 100% rename from pythonFiles/create_venv.py rename to python_files/create_venv.py diff --git a/pythonFiles/deactivate/bash/deactivate b/python_files/deactivate/bash/deactivate old mode 100755 new mode 100644 similarity index 100% rename from pythonFiles/deactivate/bash/deactivate rename to python_files/deactivate/bash/deactivate diff --git a/pythonFiles/deactivate/fish/deactivate b/python_files/deactivate/fish/deactivate old mode 100755 new mode 100644 similarity index 100% rename from pythonFiles/deactivate/fish/deactivate rename to python_files/deactivate/fish/deactivate diff --git a/pythonFiles/deactivate/powershell/deactivate.ps1 b/python_files/deactivate/powershell/deactivate.ps1 similarity index 100% rename from pythonFiles/deactivate/powershell/deactivate.ps1 rename to python_files/deactivate/powershell/deactivate.ps1 diff --git a/pythonFiles/deactivate/zsh/deactivate b/python_files/deactivate/zsh/deactivate old mode 100755 new mode 100644 similarity index 100% rename from pythonFiles/deactivate/zsh/deactivate rename to python_files/deactivate/zsh/deactivate diff --git a/pythonFiles/download_get_pip.py b/python_files/download_get_pip.py similarity index 96% rename from pythonFiles/download_get_pip.py rename to python_files/download_get_pip.py index b8238d60f261..d87d1cf032fa 100644 --- a/pythonFiles/download_get_pip.py +++ b/python_files/download_get_pip.py @@ -8,7 +8,7 @@ from packaging.version import parse as version_parser EXTENSION_ROOT = pathlib.Path(__file__).parent.parent -GET_PIP_DEST = EXTENSION_ROOT / "pythonFiles" +GET_PIP_DEST = EXTENSION_ROOT / "python_files" PIP_PACKAGE = "pip" PIP_VERSION = "latest" # Can be "latest", or specific version "23.1.2" diff --git a/pythonFiles/get_output_via_markers.py b/python_files/get_output_via_markers.py similarity index 100% rename from pythonFiles/get_output_via_markers.py rename to python_files/get_output_via_markers.py diff --git a/pythonFiles/install_debugpy.py b/python_files/install_debugpy.py similarity index 96% rename from pythonFiles/install_debugpy.py rename to python_files/install_debugpy.py index c217e81fd219..e38ca82230c9 100644 --- a/pythonFiles/install_debugpy.py +++ b/python_files/install_debugpy.py @@ -10,7 +10,7 @@ from packaging.version import parse as version_parser EXTENSION_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -DEBUGGER_DEST = os.path.join(EXTENSION_ROOT, "pythonFiles", "lib", "python") +DEBUGGER_DEST = os.path.join(EXTENSION_ROOT, "python_files", "lib", "python") DEBUGGER_PACKAGE = "debugpy" DEBUGGER_PYTHON_ABI_VERSIONS = ("cp310",) DEBUGGER_VERSION = "1.8.1" # can also be "latest" diff --git a/pythonFiles/installed_check.py b/python_files/installed_check.py similarity index 100% rename from pythonFiles/installed_check.py rename to python_files/installed_check.py diff --git a/pythonFiles/interpreterInfo.py b/python_files/interpreterInfo.py similarity index 100% rename from pythonFiles/interpreterInfo.py rename to python_files/interpreterInfo.py diff --git a/pythonFiles/jedilsp_requirements/requirements.in b/python_files/jedilsp_requirements/requirements.in similarity index 72% rename from pythonFiles/jedilsp_requirements/requirements.in rename to python_files/jedilsp_requirements/requirements.in index 0167b757cf7b..6d5404df8f0f 100644 --- a/pythonFiles/jedilsp_requirements/requirements.in +++ b/python_files/jedilsp_requirements/requirements.in @@ -2,7 +2,7 @@ # To update requirements.txt, run the following commands. # Use Python 3.8 when creating the environment or using pip-tools # 1) pip install pip-tools -# 2) pip-compile --generate-hashes --upgrade pythonFiles\jedilsp_requirements\requirements.in +# 2) pip-compile --generate-hashes --upgrade python_files\jedilsp_requirements\requirements.in jedi-language-server>=0.34.3 pygls>=0.10.3 diff --git a/pythonFiles/jedilsp_requirements/requirements.txt b/python_files/jedilsp_requirements/requirements.txt similarity index 93% rename from pythonFiles/jedilsp_requirements/requirements.txt rename to python_files/jedilsp_requirements/requirements.txt index 889f021670bf..5ee0244deb80 100644 --- a/pythonFiles/jedilsp_requirements/requirements.txt +++ b/python_files/jedilsp_requirements/requirements.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --generate-hashes 'pythonFiles\jedilsp_requirements\requirements.in' +# pip-compile --generate-hashes 'python_files\jedilsp_requirements\requirements.in' # attrs==23.1.0 \ --hash=sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04 \ @@ -35,7 +35,7 @@ jedi==0.19.1 \ jedi-language-server==0.41.1 \ --hash=sha256:3f15ca5cc28e728564f7d63583e171b418025582447ce023512e3f2b2d71ebae \ --hash=sha256:ca9b3e7f48b70f0988d85ffde4f01dd1ab94c8e0f69e8c6424e6657117b44f91 - # via -r pythonFiles\jedilsp_requirements\requirements.in + # via -r python_files\jedilsp_requirements\requirements.in lsprotocol==2023.0.0b1 \ --hash=sha256:ade2cd0fa0ede7965698cb59cd05d3adbd19178fd73e83f72ef57a032fbb9d62 \ --hash=sha256:f7a2d4655cbd5639f373ddd1789807450c543341fa0a32b064ad30dbb9f510d4 @@ -50,7 +50,7 @@ pygls==1.0.2 \ --hash=sha256:6d278d29fa6559b0f7a448263c85cb64ec6e9369548b02f1a7944060848b21f9 \ --hash=sha256:888ed63d1f650b4fc64d603d73d37545386ec533c0caac921aed80f80ea946a4 # via - # -r pythonFiles\jedilsp_requirements\requirements.in + # -r python_files\jedilsp_requirements\requirements.in # jedi-language-server typeguard==3.0.2 \ --hash=sha256:bbe993854385284ab42fd5bd3bee6f6556577ce8b50696d6cb956d704f286c8e \ diff --git a/pythonFiles/linter.py b/python_files/linter.py similarity index 100% rename from pythonFiles/linter.py rename to python_files/linter.py diff --git a/pythonFiles/normalizeSelection.py b/python_files/normalizeSelection.py similarity index 100% rename from pythonFiles/normalizeSelection.py rename to python_files/normalizeSelection.py diff --git a/pythonFiles/printEnvVariables.py b/python_files/printEnvVariables.py similarity index 100% rename from pythonFiles/printEnvVariables.py rename to python_files/printEnvVariables.py diff --git a/pythonFiles/printEnvVariablesToFile.py b/python_files/printEnvVariablesToFile.py similarity index 100% rename from pythonFiles/printEnvVariablesToFile.py rename to python_files/printEnvVariablesToFile.py diff --git a/pythonFiles/pyproject.toml b/python_files/pyproject.toml similarity index 86% rename from pythonFiles/pyproject.toml rename to python_files/pyproject.toml index d865e27418e0..151e598bd2b2 100644 --- a/pythonFiles/pyproject.toml +++ b/python_files/pyproject.toml @@ -58,10 +58,10 @@ exclude = [ 'tests/testing_tools/adapter/test_util.py', 'tests/testing_tools/adapter/pytest/test_cli.py', 'tests/testing_tools/adapter/pytest/test_discovery.py', - 'pythonFiles/testing_tools/*', - 'pythonFiles/testing_tools/adapter/pytest/__init__.py', - 'pythonFiles/tests/pytestadapter/expected_execution_test_output.py', - 'pythonFiles/tests/unittestadapter/.data/discovery_error/file_one.py', - 'pythonFiles/tests/unittestadapter/test_utils.py', + 'python_files/testing_tools/*', + 'python_files/testing_tools/adapter/pytest/__init__.py', + 'python_files/tests/pytestadapter/expected_execution_test_output.py', + 'python_files/tests/unittestadapter/.data/discovery_error/file_one.py', + 'python_files/tests/unittestadapter/test_utils.py', ] diff --git a/pythonFiles/pythonrc.py b/python_files/pythonrc.py similarity index 100% rename from pythonFiles/pythonrc.py rename to python_files/pythonrc.py diff --git a/pythonFiles/run-jedi-language-server.py b/python_files/run-jedi-language-server.py similarity index 74% rename from pythonFiles/run-jedi-language-server.py rename to python_files/run-jedi-language-server.py index 31095121409f..3239bc7e9c8c 100644 --- a/pythonFiles/run-jedi-language-server.py +++ b/python_files/run-jedi-language-server.py @@ -3,7 +3,7 @@ # Add the lib path to our sys path so jedi_language_server can find its references EXTENSION_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -sys.path.insert(0, os.path.join(EXTENSION_ROOT, "pythonFiles", "lib", "jedilsp")) +sys.path.insert(0, os.path.join(EXTENSION_ROOT, "python_files", "lib", "jedilsp")) from jedi_language_server.cli import cli diff --git a/pythonFiles/shell_exec.py b/python_files/shell_exec.py similarity index 100% rename from pythonFiles/shell_exec.py rename to python_files/shell_exec.py diff --git a/pythonFiles/tensorboard_launcher.py b/python_files/tensorboard_launcher.py similarity index 100% rename from pythonFiles/tensorboard_launcher.py rename to python_files/tensorboard_launcher.py diff --git a/pythonFiles/testing_tools/__init__.py b/python_files/testing_tools/__init__.py similarity index 100% rename from pythonFiles/testing_tools/__init__.py rename to python_files/testing_tools/__init__.py diff --git a/pythonFiles/testing_tools/adapter/__init__.py b/python_files/testing_tools/adapter/__init__.py similarity index 100% rename from pythonFiles/testing_tools/adapter/__init__.py rename to python_files/testing_tools/adapter/__init__.py diff --git a/pythonFiles/testing_tools/adapter/__main__.py b/python_files/testing_tools/adapter/__main__.py similarity index 100% rename from pythonFiles/testing_tools/adapter/__main__.py rename to python_files/testing_tools/adapter/__main__.py diff --git a/pythonFiles/testing_tools/adapter/discovery.py b/python_files/testing_tools/adapter/discovery.py similarity index 100% rename from pythonFiles/testing_tools/adapter/discovery.py rename to python_files/testing_tools/adapter/discovery.py diff --git a/pythonFiles/testing_tools/adapter/errors.py b/python_files/testing_tools/adapter/errors.py similarity index 100% rename from pythonFiles/testing_tools/adapter/errors.py rename to python_files/testing_tools/adapter/errors.py diff --git a/pythonFiles/testing_tools/adapter/info.py b/python_files/testing_tools/adapter/info.py similarity index 100% rename from pythonFiles/testing_tools/adapter/info.py rename to python_files/testing_tools/adapter/info.py diff --git a/pythonFiles/testing_tools/adapter/pytest/__init__.py b/python_files/testing_tools/adapter/pytest/__init__.py similarity index 100% rename from pythonFiles/testing_tools/adapter/pytest/__init__.py rename to python_files/testing_tools/adapter/pytest/__init__.py diff --git a/pythonFiles/testing_tools/adapter/pytest/_cli.py b/python_files/testing_tools/adapter/pytest/_cli.py similarity index 100% rename from pythonFiles/testing_tools/adapter/pytest/_cli.py rename to python_files/testing_tools/adapter/pytest/_cli.py diff --git a/pythonFiles/testing_tools/adapter/pytest/_discovery.py b/python_files/testing_tools/adapter/pytest/_discovery.py similarity index 100% rename from pythonFiles/testing_tools/adapter/pytest/_discovery.py rename to python_files/testing_tools/adapter/pytest/_discovery.py diff --git a/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py b/python_files/testing_tools/adapter/pytest/_pytest_item.py similarity index 100% rename from pythonFiles/testing_tools/adapter/pytest/_pytest_item.py rename to python_files/testing_tools/adapter/pytest/_pytest_item.py diff --git a/pythonFiles/testing_tools/adapter/report.py b/python_files/testing_tools/adapter/report.py similarity index 100% rename from pythonFiles/testing_tools/adapter/report.py rename to python_files/testing_tools/adapter/report.py diff --git a/pythonFiles/testing_tools/adapter/util.py b/python_files/testing_tools/adapter/util.py similarity index 100% rename from pythonFiles/testing_tools/adapter/util.py rename to python_files/testing_tools/adapter/util.py diff --git a/pythonFiles/testing_tools/process_json_util.py b/python_files/testing_tools/process_json_util.py similarity index 100% rename from pythonFiles/testing_tools/process_json_util.py rename to python_files/testing_tools/process_json_util.py diff --git a/pythonFiles/testing_tools/run_adapter.py b/python_files/testing_tools/run_adapter.py similarity index 81% rename from pythonFiles/testing_tools/run_adapter.py rename to python_files/testing_tools/run_adapter.py index 1eeef194f8f5..8af4e49dd31c 100644 --- a/pythonFiles/testing_tools/run_adapter.py +++ b/python_files/testing_tools/run_adapter.py @@ -7,8 +7,8 @@ sys.path.insert( 1, - os.path.dirname( # pythonFiles - os.path.dirname( # pythonFiles/testing_tools + os.path.dirname( # python_files + os.path.dirname( # python_files/testing_tools os.path.abspath(__file__) # this file ) ), diff --git a/pythonFiles/testing_tools/socket_manager.py b/python_files/testing_tools/socket_manager.py similarity index 100% rename from pythonFiles/testing_tools/socket_manager.py rename to python_files/testing_tools/socket_manager.py diff --git a/pythonFiles/testing_tools/unittest_discovery.py b/python_files/testing_tools/unittest_discovery.py similarity index 100% rename from pythonFiles/testing_tools/unittest_discovery.py rename to python_files/testing_tools/unittest_discovery.py diff --git a/pythonFiles/testlauncher.py b/python_files/testlauncher.py similarity index 100% rename from pythonFiles/testlauncher.py rename to python_files/testlauncher.py diff --git a/pythonFiles/tests/__init__.py b/python_files/tests/__init__.py similarity index 100% rename from pythonFiles/tests/__init__.py rename to python_files/tests/__init__.py diff --git a/pythonFiles/tests/__main__.py b/python_files/tests/__main__.py similarity index 100% rename from pythonFiles/tests/__main__.py rename to python_files/tests/__main__.py diff --git a/pythonFiles/tests/debug_adapter/__init__.py b/python_files/tests/debug_adapter/__init__.py similarity index 100% rename from pythonFiles/tests/debug_adapter/__init__.py rename to python_files/tests/debug_adapter/__init__.py diff --git a/pythonFiles/tests/debug_adapter/test_install_debugpy.py b/python_files/tests/debug_adapter/test_install_debugpy.py similarity index 100% rename from pythonFiles/tests/debug_adapter/test_install_debugpy.py rename to python_files/tests/debug_adapter/test_install_debugpy.py diff --git a/pythonFiles/tests/pytestadapter/.data/dual_level_nested_folder/nested_folder_one/test_bottom_folder.py b/python_files/tests/pytestadapter/.data/dual_level_nested_folder/nested_folder_one/test_bottom_folder.py similarity index 100% rename from pythonFiles/tests/pytestadapter/.data/dual_level_nested_folder/nested_folder_one/test_bottom_folder.py rename to python_files/tests/pytestadapter/.data/dual_level_nested_folder/nested_folder_one/test_bottom_folder.py diff --git a/pythonFiles/tests/pytestadapter/.data/dual_level_nested_folder/test_top_folder.py b/python_files/tests/pytestadapter/.data/dual_level_nested_folder/test_top_folder.py similarity index 100% rename from pythonFiles/tests/pytestadapter/.data/dual_level_nested_folder/test_top_folder.py rename to python_files/tests/pytestadapter/.data/dual_level_nested_folder/test_top_folder.py diff --git a/pythonFiles/tests/pytestadapter/.data/empty_discovery.py b/python_files/tests/pytestadapter/.data/empty_discovery.py similarity index 100% rename from pythonFiles/tests/pytestadapter/.data/empty_discovery.py rename to python_files/tests/pytestadapter/.data/empty_discovery.py diff --git a/pythonFiles/tests/pytestadapter/.data/error_parametrize_discovery.py b/python_files/tests/pytestadapter/.data/error_parametrize_discovery.py similarity index 100% rename from pythonFiles/tests/pytestadapter/.data/error_parametrize_discovery.py rename to python_files/tests/pytestadapter/.data/error_parametrize_discovery.py diff --git a/pythonFiles/tests/pytestadapter/.data/error_pytest_import.txt b/python_files/tests/pytestadapter/.data/error_pytest_import.txt similarity index 100% rename from pythonFiles/tests/pytestadapter/.data/error_pytest_import.txt rename to python_files/tests/pytestadapter/.data/error_pytest_import.txt diff --git a/pythonFiles/tests/pytestadapter/.data/error_raise_exception.py b/python_files/tests/pytestadapter/.data/error_raise_exception.py similarity index 100% rename from pythonFiles/tests/pytestadapter/.data/error_raise_exception.py rename to python_files/tests/pytestadapter/.data/error_raise_exception.py diff --git a/pythonFiles/tests/pytestadapter/.data/error_syntax_discovery.txt b/python_files/tests/pytestadapter/.data/error_syntax_discovery.txt similarity index 100% rename from pythonFiles/tests/pytestadapter/.data/error_syntax_discovery.txt rename to python_files/tests/pytestadapter/.data/error_syntax_discovery.txt diff --git a/pythonFiles/tests/pytestadapter/.data/folder_a/folder_b/folder_a/test_nest.py b/python_files/tests/pytestadapter/.data/folder_a/folder_b/folder_a/test_nest.py similarity index 100% rename from pythonFiles/tests/pytestadapter/.data/folder_a/folder_b/folder_a/test_nest.py rename to python_files/tests/pytestadapter/.data/folder_a/folder_b/folder_a/test_nest.py diff --git a/pythonFiles/tests/pytestadapter/.data/param_same_name/test_param1.py b/python_files/tests/pytestadapter/.data/param_same_name/test_param1.py similarity index 100% rename from pythonFiles/tests/pytestadapter/.data/param_same_name/test_param1.py rename to python_files/tests/pytestadapter/.data/param_same_name/test_param1.py diff --git a/pythonFiles/tests/pytestadapter/.data/param_same_name/test_param2.py b/python_files/tests/pytestadapter/.data/param_same_name/test_param2.py similarity index 100% rename from pythonFiles/tests/pytestadapter/.data/param_same_name/test_param2.py rename to python_files/tests/pytestadapter/.data/param_same_name/test_param2.py diff --git a/pythonFiles/tests/pytestadapter/.data/parametrize_tests.py b/python_files/tests/pytestadapter/.data/parametrize_tests.py similarity index 100% rename from pythonFiles/tests/pytestadapter/.data/parametrize_tests.py rename to python_files/tests/pytestadapter/.data/parametrize_tests.py diff --git a/pythonFiles/tests/pytestadapter/.data/root/tests/pytest.ini b/python_files/tests/pytestadapter/.data/root/tests/pytest.ini similarity index 100% rename from pythonFiles/tests/pytestadapter/.data/root/tests/pytest.ini rename to python_files/tests/pytestadapter/.data/root/tests/pytest.ini diff --git a/pythonFiles/tests/pytestadapter/.data/root/tests/test_a.py b/python_files/tests/pytestadapter/.data/root/tests/test_a.py similarity index 100% rename from pythonFiles/tests/pytestadapter/.data/root/tests/test_a.py rename to python_files/tests/pytestadapter/.data/root/tests/test_a.py diff --git a/pythonFiles/tests/pytestadapter/.data/root/tests/test_b.py b/python_files/tests/pytestadapter/.data/root/tests/test_b.py similarity index 100% rename from pythonFiles/tests/pytestadapter/.data/root/tests/test_b.py rename to python_files/tests/pytestadapter/.data/root/tests/test_b.py diff --git a/pythonFiles/tests/pytestadapter/.data/simple_pytest.py b/python_files/tests/pytestadapter/.data/simple_pytest.py similarity index 100% rename from pythonFiles/tests/pytestadapter/.data/simple_pytest.py rename to python_files/tests/pytestadapter/.data/simple_pytest.py diff --git a/pythonFiles/tests/pytestadapter/.data/skip_tests.py b/python_files/tests/pytestadapter/.data/skip_tests.py similarity index 100% rename from pythonFiles/tests/pytestadapter/.data/skip_tests.py rename to python_files/tests/pytestadapter/.data/skip_tests.py diff --git a/pythonFiles/tests/pytestadapter/.data/test_env_vars.py b/python_files/tests/pytestadapter/.data/test_env_vars.py similarity index 100% rename from pythonFiles/tests/pytestadapter/.data/test_env_vars.py rename to python_files/tests/pytestadapter/.data/test_env_vars.py diff --git a/pythonFiles/tests/pytestadapter/.data/test_logging.py b/python_files/tests/pytestadapter/.data/test_logging.py similarity index 100% rename from pythonFiles/tests/pytestadapter/.data/test_logging.py rename to python_files/tests/pytestadapter/.data/test_logging.py diff --git a/pythonFiles/tests/pytestadapter/.data/test_multi_class_nest.py b/python_files/tests/pytestadapter/.data/test_multi_class_nest.py similarity index 100% rename from pythonFiles/tests/pytestadapter/.data/test_multi_class_nest.py rename to python_files/tests/pytestadapter/.data/test_multi_class_nest.py diff --git a/pythonFiles/tests/pytestadapter/.data/text_docstring.txt b/python_files/tests/pytestadapter/.data/text_docstring.txt similarity index 100% rename from pythonFiles/tests/pytestadapter/.data/text_docstring.txt rename to python_files/tests/pytestadapter/.data/text_docstring.txt diff --git a/pythonFiles/tests/pytestadapter/.data/unittest_folder/test_add.py b/python_files/tests/pytestadapter/.data/unittest_folder/test_add.py similarity index 100% rename from pythonFiles/tests/pytestadapter/.data/unittest_folder/test_add.py rename to python_files/tests/pytestadapter/.data/unittest_folder/test_add.py diff --git a/pythonFiles/tests/pytestadapter/.data/unittest_folder/test_subtract.py b/python_files/tests/pytestadapter/.data/unittest_folder/test_subtract.py similarity index 100% rename from pythonFiles/tests/pytestadapter/.data/unittest_folder/test_subtract.py rename to python_files/tests/pytestadapter/.data/unittest_folder/test_subtract.py diff --git a/pythonFiles/tests/pytestadapter/.data/unittest_pytest_same_file.py b/python_files/tests/pytestadapter/.data/unittest_pytest_same_file.py similarity index 100% rename from pythonFiles/tests/pytestadapter/.data/unittest_pytest_same_file.py rename to python_files/tests/pytestadapter/.data/unittest_pytest_same_file.py diff --git a/pythonFiles/tests/pytestadapter/.data/unittest_skiptest_file_level.py b/python_files/tests/pytestadapter/.data/unittest_skiptest_file_level.py similarity index 100% rename from pythonFiles/tests/pytestadapter/.data/unittest_skiptest_file_level.py rename to python_files/tests/pytestadapter/.data/unittest_skiptest_file_level.py diff --git a/pythonFiles/tests/pytestadapter/__init__.py b/python_files/tests/pytestadapter/__init__.py similarity index 100% rename from pythonFiles/tests/pytestadapter/__init__.py rename to python_files/tests/pytestadapter/__init__.py diff --git a/pythonFiles/tests/pytestadapter/expected_discovery_test_output.py b/python_files/tests/pytestadapter/expected_discovery_test_output.py similarity index 100% rename from pythonFiles/tests/pytestadapter/expected_discovery_test_output.py rename to python_files/tests/pytestadapter/expected_discovery_test_output.py diff --git a/pythonFiles/tests/pytestadapter/expected_execution_test_output.py b/python_files/tests/pytestadapter/expected_execution_test_output.py similarity index 100% rename from pythonFiles/tests/pytestadapter/expected_execution_test_output.py rename to python_files/tests/pytestadapter/expected_execution_test_output.py diff --git a/pythonFiles/tests/pytestadapter/helpers.py b/python_files/tests/pytestadapter/helpers.py similarity index 100% rename from pythonFiles/tests/pytestadapter/helpers.py rename to python_files/tests/pytestadapter/helpers.py diff --git a/pythonFiles/tests/pytestadapter/test_discovery.py b/python_files/tests/pytestadapter/test_discovery.py similarity index 100% rename from pythonFiles/tests/pytestadapter/test_discovery.py rename to python_files/tests/pytestadapter/test_discovery.py diff --git a/pythonFiles/tests/pytestadapter/test_execution.py b/python_files/tests/pytestadapter/test_execution.py similarity index 100% rename from pythonFiles/tests/pytestadapter/test_execution.py rename to python_files/tests/pytestadapter/test_execution.py diff --git a/pythonFiles/tests/run_all.py b/python_files/tests/run_all.py similarity index 100% rename from pythonFiles/tests/run_all.py rename to python_files/tests/run_all.py diff --git a/pythonFiles/tests/test_create_conda.py b/python_files/tests/test_create_conda.py similarity index 100% rename from pythonFiles/tests/test_create_conda.py rename to python_files/tests/test_create_conda.py diff --git a/pythonFiles/tests/test_create_microvenv.py b/python_files/tests/test_create_microvenv.py similarity index 100% rename from pythonFiles/tests/test_create_microvenv.py rename to python_files/tests/test_create_microvenv.py diff --git a/pythonFiles/tests/test_create_venv.py b/python_files/tests/test_create_venv.py similarity index 100% rename from pythonFiles/tests/test_create_venv.py rename to python_files/tests/test_create_venv.py diff --git a/pythonFiles/tests/test_data/missing-deps.data b/python_files/tests/test_data/missing-deps.data similarity index 100% rename from pythonFiles/tests/test_data/missing-deps.data rename to python_files/tests/test_data/missing-deps.data diff --git a/pythonFiles/tests/test_data/no-missing-deps.data b/python_files/tests/test_data/no-missing-deps.data similarity index 100% rename from pythonFiles/tests/test_data/no-missing-deps.data rename to python_files/tests/test_data/no-missing-deps.data diff --git a/pythonFiles/tests/test_data/pyproject-missing-deps.data b/python_files/tests/test_data/pyproject-missing-deps.data similarity index 100% rename from pythonFiles/tests/test_data/pyproject-missing-deps.data rename to python_files/tests/test_data/pyproject-missing-deps.data diff --git a/pythonFiles/tests/test_data/pyproject-no-missing-deps.data b/python_files/tests/test_data/pyproject-no-missing-deps.data similarity index 100% rename from pythonFiles/tests/test_data/pyproject-no-missing-deps.data rename to python_files/tests/test_data/pyproject-no-missing-deps.data diff --git a/pythonFiles/tests/test_dynamic_cursor.py b/python_files/tests/test_dynamic_cursor.py similarity index 100% rename from pythonFiles/tests/test_dynamic_cursor.py rename to python_files/tests/test_dynamic_cursor.py diff --git a/pythonFiles/tests/test_installed_check.py b/python_files/tests/test_installed_check.py similarity index 100% rename from pythonFiles/tests/test_installed_check.py rename to python_files/tests/test_installed_check.py diff --git a/pythonFiles/tests/test_normalize_selection.py b/python_files/tests/test_normalize_selection.py similarity index 98% rename from pythonFiles/tests/test_normalize_selection.py rename to python_files/tests/test_normalize_selection.py index 5f4d6d7d4a1f..60dfddb11e2d 100644 --- a/pythonFiles/tests/test_normalize_selection.py +++ b/python_files/tests/test_normalize_selection.py @@ -5,7 +5,7 @@ import importlib import textwrap -# __file__ = "/Users/anthonykim/Desktop/vscode-python/pythonFiles/normalizeSelection.py" +# __file__ = "/Users/anthonykim/Desktop/vscode-python/python_files/normalizeSelection.py" # sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__)))) import normalizeSelection diff --git a/pythonFiles/tests/test_shell_integration.py b/python_files/tests/test_shell_integration.py similarity index 100% rename from pythonFiles/tests/test_shell_integration.py rename to python_files/tests/test_shell_integration.py diff --git a/pythonFiles/tests/test_smart_selection.py b/python_files/tests/test_smart_selection.py similarity index 100% rename from pythonFiles/tests/test_smart_selection.py rename to python_files/tests/test_smart_selection.py diff --git a/pythonFiles/tests/testing_tools/__init__.py b/python_files/tests/testing_tools/__init__.py similarity index 100% rename from pythonFiles/tests/testing_tools/__init__.py rename to python_files/tests/testing_tools/__init__.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/NormCase/tests/A/__init__.py b/python_files/tests/testing_tools/adapter/.data/NormCase/tests/A/__init__.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/NormCase/tests/A/__init__.py rename to python_files/tests/testing_tools/adapter/.data/NormCase/tests/A/__init__.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/NormCase/tests/A/b/C/__init__.py b/python_files/tests/testing_tools/adapter/.data/NormCase/tests/A/b/C/__init__.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/NormCase/tests/A/b/C/__init__.py rename to python_files/tests/testing_tools/adapter/.data/NormCase/tests/A/b/C/__init__.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/NormCase/tests/A/b/C/test_Spam.py b/python_files/tests/testing_tools/adapter/.data/NormCase/tests/A/b/C/test_Spam.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/NormCase/tests/A/b/C/test_Spam.py rename to python_files/tests/testing_tools/adapter/.data/NormCase/tests/A/b/C/test_Spam.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/NormCase/tests/A/b/__init__.py b/python_files/tests/testing_tools/adapter/.data/NormCase/tests/A/b/__init__.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/NormCase/tests/A/b/__init__.py rename to python_files/tests/testing_tools/adapter/.data/NormCase/tests/A/b/__init__.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/NormCase/tests/__init__.py b/python_files/tests/testing_tools/adapter/.data/NormCase/tests/__init__.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/NormCase/tests/__init__.py rename to python_files/tests/testing_tools/adapter/.data/NormCase/tests/__init__.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/complex/README.md b/python_files/tests/testing_tools/adapter/.data/complex/README.md similarity index 99% rename from pythonFiles/tests/testing_tools/adapter/.data/complex/README.md rename to python_files/tests/testing_tools/adapter/.data/complex/README.md index e30e96142d02..8840cda1e834 100644 --- a/pythonFiles/tests/testing_tools/adapter/.data/complex/README.md +++ b/python_files/tests/testing_tools/adapter/.data/complex/README.md @@ -1,7 +1,7 @@ ## Directory Structure ``` -pythonFiles/tests/testing_tools/adapter/.data/ +python_files/tests/testing_tools/adapter/.data/ tests/ # test root test_doctest.txt test_pytest.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/complex/mod.py b/python_files/tests/testing_tools/adapter/.data/complex/mod.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/complex/mod.py rename to python_files/tests/testing_tools/adapter/.data/complex/mod.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/complex/tests/__init__.py b/python_files/tests/testing_tools/adapter/.data/complex/tests/__init__.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/complex/tests/__init__.py rename to python_files/tests/testing_tools/adapter/.data/complex/tests/__init__.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/complex/tests/spam.py b/python_files/tests/testing_tools/adapter/.data/complex/tests/spam.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/complex/tests/spam.py rename to python_files/tests/testing_tools/adapter/.data/complex/tests/spam.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/complex/tests/test_42-43.py b/python_files/tests/testing_tools/adapter/.data/complex/tests/test_42-43.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/complex/tests/test_42-43.py rename to python_files/tests/testing_tools/adapter/.data/complex/tests/test_42-43.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/complex/tests/test_42.py b/python_files/tests/testing_tools/adapter/.data/complex/tests/test_42.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/complex/tests/test_42.py rename to python_files/tests/testing_tools/adapter/.data/complex/tests/test_42.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/complex/tests/test_doctest.py b/python_files/tests/testing_tools/adapter/.data/complex/tests/test_doctest.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/complex/tests/test_doctest.py rename to python_files/tests/testing_tools/adapter/.data/complex/tests/test_doctest.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/complex/tests/test_doctest.txt b/python_files/tests/testing_tools/adapter/.data/complex/tests/test_doctest.txt similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/complex/tests/test_doctest.txt rename to python_files/tests/testing_tools/adapter/.data/complex/tests/test_doctest.txt diff --git a/pythonFiles/tests/testing_tools/adapter/.data/complex/tests/test_foo.py b/python_files/tests/testing_tools/adapter/.data/complex/tests/test_foo.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/complex/tests/test_foo.py rename to python_files/tests/testing_tools/adapter/.data/complex/tests/test_foo.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/complex/tests/test_mixed.py b/python_files/tests/testing_tools/adapter/.data/complex/tests/test_mixed.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/complex/tests/test_mixed.py rename to python_files/tests/testing_tools/adapter/.data/complex/tests/test_mixed.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/complex/tests/test_pytest.py b/python_files/tests/testing_tools/adapter/.data/complex/tests/test_pytest.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/complex/tests/test_pytest.py rename to python_files/tests/testing_tools/adapter/.data/complex/tests/test_pytest.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/complex/tests/test_pytest_param.py b/python_files/tests/testing_tools/adapter/.data/complex/tests/test_pytest_param.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/complex/tests/test_pytest_param.py rename to python_files/tests/testing_tools/adapter/.data/complex/tests/test_pytest_param.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/complex/tests/test_unittest.py b/python_files/tests/testing_tools/adapter/.data/complex/tests/test_unittest.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/complex/tests/test_unittest.py rename to python_files/tests/testing_tools/adapter/.data/complex/tests/test_unittest.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/complex/tests/testspam.py b/python_files/tests/testing_tools/adapter/.data/complex/tests/testspam.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/complex/tests/testspam.py rename to python_files/tests/testing_tools/adapter/.data/complex/tests/testspam.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/complex/tests/v/__init__.py b/python_files/tests/testing_tools/adapter/.data/complex/tests/v/__init__.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/complex/tests/v/__init__.py rename to python_files/tests/testing_tools/adapter/.data/complex/tests/v/__init__.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/complex/tests/v/spam.py b/python_files/tests/testing_tools/adapter/.data/complex/tests/v/spam.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/complex/tests/v/spam.py rename to python_files/tests/testing_tools/adapter/.data/complex/tests/v/spam.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/complex/tests/v/test_eggs.py b/python_files/tests/testing_tools/adapter/.data/complex/tests/v/test_eggs.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/complex/tests/v/test_eggs.py rename to python_files/tests/testing_tools/adapter/.data/complex/tests/v/test_eggs.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/complex/tests/v/test_ham.py b/python_files/tests/testing_tools/adapter/.data/complex/tests/v/test_ham.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/complex/tests/v/test_ham.py rename to python_files/tests/testing_tools/adapter/.data/complex/tests/v/test_ham.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/complex/tests/v/test_spam.py b/python_files/tests/testing_tools/adapter/.data/complex/tests/v/test_spam.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/complex/tests/v/test_spam.py rename to python_files/tests/testing_tools/adapter/.data/complex/tests/v/test_spam.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/complex/tests/w/test_spam.py b/python_files/tests/testing_tools/adapter/.data/complex/tests/w/test_spam.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/complex/tests/w/test_spam.py rename to python_files/tests/testing_tools/adapter/.data/complex/tests/w/test_spam.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/complex/tests/w/test_spam_ex.py b/python_files/tests/testing_tools/adapter/.data/complex/tests/w/test_spam_ex.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/complex/tests/w/test_spam_ex.py rename to python_files/tests/testing_tools/adapter/.data/complex/tests/w/test_spam_ex.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/complex/tests/x/__init__.py b/python_files/tests/testing_tools/adapter/.data/complex/tests/x/__init__.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/complex/tests/x/__init__.py rename to python_files/tests/testing_tools/adapter/.data/complex/tests/x/__init__.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/complex/tests/x/y/__init__.py b/python_files/tests/testing_tools/adapter/.data/complex/tests/x/y/__init__.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/complex/tests/x/y/__init__.py rename to python_files/tests/testing_tools/adapter/.data/complex/tests/x/y/__init__.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/complex/tests/x/y/z/__init__.py b/python_files/tests/testing_tools/adapter/.data/complex/tests/x/y/z/__init__.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/complex/tests/x/y/z/__init__.py rename to python_files/tests/testing_tools/adapter/.data/complex/tests/x/y/z/__init__.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/complex/tests/x/y/z/a/__init__.py b/python_files/tests/testing_tools/adapter/.data/complex/tests/x/y/z/a/__init__.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/complex/tests/x/y/z/a/__init__.py rename to python_files/tests/testing_tools/adapter/.data/complex/tests/x/y/z/a/__init__.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/complex/tests/x/y/z/a/test_spam.py b/python_files/tests/testing_tools/adapter/.data/complex/tests/x/y/z/a/test_spam.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/complex/tests/x/y/z/a/test_spam.py rename to python_files/tests/testing_tools/adapter/.data/complex/tests/x/y/z/a/test_spam.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/complex/tests/x/y/z/b/__init__.py b/python_files/tests/testing_tools/adapter/.data/complex/tests/x/y/z/b/__init__.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/complex/tests/x/y/z/b/__init__.py rename to python_files/tests/testing_tools/adapter/.data/complex/tests/x/y/z/b/__init__.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/complex/tests/x/y/z/b/test_spam.py b/python_files/tests/testing_tools/adapter/.data/complex/tests/x/y/z/b/test_spam.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/complex/tests/x/y/z/b/test_spam.py rename to python_files/tests/testing_tools/adapter/.data/complex/tests/x/y/z/b/test_spam.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/complex/tests/x/y/z/test_ham.py b/python_files/tests/testing_tools/adapter/.data/complex/tests/x/y/z/test_ham.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/complex/tests/x/y/z/test_ham.py rename to python_files/tests/testing_tools/adapter/.data/complex/tests/x/y/z/test_ham.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/notests/tests/__init__.py b/python_files/tests/testing_tools/adapter/.data/notests/tests/__init__.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/notests/tests/__init__.py rename to python_files/tests/testing_tools/adapter/.data/notests/tests/__init__.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/simple/tests/__init__.py b/python_files/tests/testing_tools/adapter/.data/simple/tests/__init__.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/simple/tests/__init__.py rename to python_files/tests/testing_tools/adapter/.data/simple/tests/__init__.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/simple/tests/test_spam.py b/python_files/tests/testing_tools/adapter/.data/simple/tests/test_spam.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/simple/tests/test_spam.py rename to python_files/tests/testing_tools/adapter/.data/simple/tests/test_spam.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/syntax-error/tests/__init__.py b/python_files/tests/testing_tools/adapter/.data/syntax-error/tests/__init__.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/syntax-error/tests/__init__.py rename to python_files/tests/testing_tools/adapter/.data/syntax-error/tests/__init__.py diff --git a/pythonFiles/tests/testing_tools/adapter/.data/syntax-error/tests/test_spam.py b/python_files/tests/testing_tools/adapter/.data/syntax-error/tests/test_spam.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/.data/syntax-error/tests/test_spam.py rename to python_files/tests/testing_tools/adapter/.data/syntax-error/tests/test_spam.py diff --git a/pythonFiles/tests/testing_tools/adapter/__init__.py b/python_files/tests/testing_tools/adapter/__init__.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/__init__.py rename to python_files/tests/testing_tools/adapter/__init__.py diff --git a/pythonFiles/tests/testing_tools/adapter/pytest/__init__.py b/python_files/tests/testing_tools/adapter/pytest/__init__.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/pytest/__init__.py rename to python_files/tests/testing_tools/adapter/pytest/__init__.py diff --git a/pythonFiles/tests/testing_tools/adapter/pytest/test_cli.py b/python_files/tests/testing_tools/adapter/pytest/test_cli.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/pytest/test_cli.py rename to python_files/tests/testing_tools/adapter/pytest/test_cli.py diff --git a/pythonFiles/tests/testing_tools/adapter/pytest/test_discovery.py b/python_files/tests/testing_tools/adapter/pytest/test_discovery.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/pytest/test_discovery.py rename to python_files/tests/testing_tools/adapter/pytest/test_discovery.py diff --git a/pythonFiles/tests/testing_tools/adapter/test___main__.py b/python_files/tests/testing_tools/adapter/test___main__.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/test___main__.py rename to python_files/tests/testing_tools/adapter/test___main__.py diff --git a/pythonFiles/tests/testing_tools/adapter/test_discovery.py b/python_files/tests/testing_tools/adapter/test_discovery.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/test_discovery.py rename to python_files/tests/testing_tools/adapter/test_discovery.py diff --git a/pythonFiles/tests/testing_tools/adapter/test_functional.py b/python_files/tests/testing_tools/adapter/test_functional.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/test_functional.py rename to python_files/tests/testing_tools/adapter/test_functional.py diff --git a/pythonFiles/tests/testing_tools/adapter/test_report.py b/python_files/tests/testing_tools/adapter/test_report.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/test_report.py rename to python_files/tests/testing_tools/adapter/test_report.py diff --git a/pythonFiles/tests/testing_tools/adapter/test_util.py b/python_files/tests/testing_tools/adapter/test_util.py similarity index 100% rename from pythonFiles/tests/testing_tools/adapter/test_util.py rename to python_files/tests/testing_tools/adapter/test_util.py diff --git a/pythonFiles/tests/tree_comparison_helper.py b/python_files/tests/tree_comparison_helper.py similarity index 100% rename from pythonFiles/tests/tree_comparison_helper.py rename to python_files/tests/tree_comparison_helper.py diff --git a/pythonFiles/tests/unittestadapter/.data/discovery_empty.py b/python_files/tests/unittestadapter/.data/discovery_empty.py similarity index 100% rename from pythonFiles/tests/unittestadapter/.data/discovery_empty.py rename to python_files/tests/unittestadapter/.data/discovery_empty.py diff --git a/pythonFiles/tests/unittestadapter/.data/discovery_error/file_one.py b/python_files/tests/unittestadapter/.data/discovery_error/file_one.py similarity index 100% rename from pythonFiles/tests/unittestadapter/.data/discovery_error/file_one.py rename to python_files/tests/unittestadapter/.data/discovery_error/file_one.py diff --git a/pythonFiles/tests/unittestadapter/.data/discovery_error/file_two.py b/python_files/tests/unittestadapter/.data/discovery_error/file_two.py similarity index 100% rename from pythonFiles/tests/unittestadapter/.data/discovery_error/file_two.py rename to python_files/tests/unittestadapter/.data/discovery_error/file_two.py diff --git a/pythonFiles/tests/unittestadapter/.data/discovery_simple.py b/python_files/tests/unittestadapter/.data/discovery_simple.py similarity index 100% rename from pythonFiles/tests/unittestadapter/.data/discovery_simple.py rename to python_files/tests/unittestadapter/.data/discovery_simple.py diff --git a/pythonFiles/tests/unittestadapter/.data/test_fail_simple.py b/python_files/tests/unittestadapter/.data/test_fail_simple.py similarity index 100% rename from pythonFiles/tests/unittestadapter/.data/test_fail_simple.py rename to python_files/tests/unittestadapter/.data/test_fail_simple.py diff --git a/pythonFiles/tests/unittestadapter/.data/test_subtest.py b/python_files/tests/unittestadapter/.data/test_subtest.py similarity index 100% rename from pythonFiles/tests/unittestadapter/.data/test_subtest.py rename to python_files/tests/unittestadapter/.data/test_subtest.py diff --git a/pythonFiles/tests/unittestadapter/.data/test_two_classes.py b/python_files/tests/unittestadapter/.data/test_two_classes.py similarity index 100% rename from pythonFiles/tests/unittestadapter/.data/test_two_classes.py rename to python_files/tests/unittestadapter/.data/test_two_classes.py diff --git a/pythonFiles/tests/unittestadapter/.data/two_patterns/pattern_a_test.py b/python_files/tests/unittestadapter/.data/two_patterns/pattern_a_test.py similarity index 100% rename from pythonFiles/tests/unittestadapter/.data/two_patterns/pattern_a_test.py rename to python_files/tests/unittestadapter/.data/two_patterns/pattern_a_test.py diff --git a/pythonFiles/tests/unittestadapter/.data/two_patterns/test_pattern_b.py b/python_files/tests/unittestadapter/.data/two_patterns/test_pattern_b.py similarity index 100% rename from pythonFiles/tests/unittestadapter/.data/two_patterns/test_pattern_b.py rename to python_files/tests/unittestadapter/.data/two_patterns/test_pattern_b.py diff --git a/pythonFiles/tests/unittestadapter/.data/unittest_folder/test_add.py b/python_files/tests/unittestadapter/.data/unittest_folder/test_add.py similarity index 100% rename from pythonFiles/tests/unittestadapter/.data/unittest_folder/test_add.py rename to python_files/tests/unittestadapter/.data/unittest_folder/test_add.py diff --git a/pythonFiles/tests/unittestadapter/.data/unittest_folder/test_subtract.py b/python_files/tests/unittestadapter/.data/unittest_folder/test_subtract.py similarity index 100% rename from pythonFiles/tests/unittestadapter/.data/unittest_folder/test_subtract.py rename to python_files/tests/unittestadapter/.data/unittest_folder/test_subtract.py diff --git a/pythonFiles/tests/unittestadapter/.data/unittest_skip/unittest_skip_file.py b/python_files/tests/unittestadapter/.data/unittest_skip/unittest_skip_file.py similarity index 100% rename from pythonFiles/tests/unittestadapter/.data/unittest_skip/unittest_skip_file.py rename to python_files/tests/unittestadapter/.data/unittest_skip/unittest_skip_file.py diff --git a/pythonFiles/tests/unittestadapter/.data/unittest_skip/unittest_skip_function.py b/python_files/tests/unittestadapter/.data/unittest_skip/unittest_skip_function.py similarity index 100% rename from pythonFiles/tests/unittestadapter/.data/unittest_skip/unittest_skip_function.py rename to python_files/tests/unittestadapter/.data/unittest_skip/unittest_skip_function.py diff --git a/pythonFiles/tests/unittestadapter/.data/utils_complex_tree/__init__.py b/python_files/tests/unittestadapter/.data/utils_complex_tree/__init__.py similarity index 100% rename from pythonFiles/tests/unittestadapter/.data/utils_complex_tree/__init__.py rename to python_files/tests/unittestadapter/.data/utils_complex_tree/__init__.py diff --git a/pythonFiles/tests/unittestadapter/.data/utils_complex_tree/test_outer_folder/__init__.py b/python_files/tests/unittestadapter/.data/utils_complex_tree/test_outer_folder/__init__.py similarity index 100% rename from pythonFiles/tests/unittestadapter/.data/utils_complex_tree/test_outer_folder/__init__.py rename to python_files/tests/unittestadapter/.data/utils_complex_tree/test_outer_folder/__init__.py diff --git a/pythonFiles/tests/unittestadapter/.data/utils_complex_tree/test_outer_folder/test_inner_folder/__init__.py b/python_files/tests/unittestadapter/.data/utils_complex_tree/test_outer_folder/test_inner_folder/__init__.py similarity index 100% rename from pythonFiles/tests/unittestadapter/.data/utils_complex_tree/test_outer_folder/test_inner_folder/__init__.py rename to python_files/tests/unittestadapter/.data/utils_complex_tree/test_outer_folder/test_inner_folder/__init__.py diff --git a/pythonFiles/tests/unittestadapter/.data/utils_complex_tree/test_outer_folder/test_inner_folder/test_utils_complex_tree.py b/python_files/tests/unittestadapter/.data/utils_complex_tree/test_outer_folder/test_inner_folder/test_utils_complex_tree.py similarity index 100% rename from pythonFiles/tests/unittestadapter/.data/utils_complex_tree/test_outer_folder/test_inner_folder/test_utils_complex_tree.py rename to python_files/tests/unittestadapter/.data/utils_complex_tree/test_outer_folder/test_inner_folder/test_utils_complex_tree.py diff --git a/pythonFiles/tests/unittestadapter/.data/utils_decorated_tree.py b/python_files/tests/unittestadapter/.data/utils_decorated_tree.py similarity index 100% rename from pythonFiles/tests/unittestadapter/.data/utils_decorated_tree.py rename to python_files/tests/unittestadapter/.data/utils_decorated_tree.py diff --git a/pythonFiles/tests/unittestadapter/.data/utils_nested_cases/file_one.py b/python_files/tests/unittestadapter/.data/utils_nested_cases/file_one.py similarity index 100% rename from pythonFiles/tests/unittestadapter/.data/utils_nested_cases/file_one.py rename to python_files/tests/unittestadapter/.data/utils_nested_cases/file_one.py diff --git a/pythonFiles/tests/unittestadapter/.data/utils_nested_cases/folder/__init__.py b/python_files/tests/unittestadapter/.data/utils_nested_cases/folder/__init__.py similarity index 100% rename from pythonFiles/tests/unittestadapter/.data/utils_nested_cases/folder/__init__.py rename to python_files/tests/unittestadapter/.data/utils_nested_cases/folder/__init__.py diff --git a/pythonFiles/tests/unittestadapter/.data/utils_nested_cases/folder/file_two.py b/python_files/tests/unittestadapter/.data/utils_nested_cases/folder/file_two.py similarity index 100% rename from pythonFiles/tests/unittestadapter/.data/utils_nested_cases/folder/file_two.py rename to python_files/tests/unittestadapter/.data/utils_nested_cases/folder/file_two.py diff --git a/pythonFiles/tests/unittestadapter/.data/utils_simple_cases.py b/python_files/tests/unittestadapter/.data/utils_simple_cases.py similarity index 100% rename from pythonFiles/tests/unittestadapter/.data/utils_simple_cases.py rename to python_files/tests/unittestadapter/.data/utils_simple_cases.py diff --git a/pythonFiles/tests/unittestadapter/.data/utils_simple_tree.py b/python_files/tests/unittestadapter/.data/utils_simple_tree.py similarity index 100% rename from pythonFiles/tests/unittestadapter/.data/utils_simple_tree.py rename to python_files/tests/unittestadapter/.data/utils_simple_tree.py diff --git a/pythonFiles/tests/unittestadapter/__init__.py b/python_files/tests/unittestadapter/__init__.py similarity index 100% rename from pythonFiles/tests/unittestadapter/__init__.py rename to python_files/tests/unittestadapter/__init__.py diff --git a/pythonFiles/tests/unittestadapter/conftest.py b/python_files/tests/unittestadapter/conftest.py similarity index 100% rename from pythonFiles/tests/unittestadapter/conftest.py rename to python_files/tests/unittestadapter/conftest.py diff --git a/pythonFiles/tests/unittestadapter/expected_discovery_test_output.py b/python_files/tests/unittestadapter/expected_discovery_test_output.py similarity index 100% rename from pythonFiles/tests/unittestadapter/expected_discovery_test_output.py rename to python_files/tests/unittestadapter/expected_discovery_test_output.py diff --git a/pythonFiles/tests/unittestadapter/test_discovery.py b/python_files/tests/unittestadapter/test_discovery.py similarity index 100% rename from pythonFiles/tests/unittestadapter/test_discovery.py rename to python_files/tests/unittestadapter/test_discovery.py diff --git a/pythonFiles/tests/unittestadapter/test_execution.py b/python_files/tests/unittestadapter/test_execution.py similarity index 100% rename from pythonFiles/tests/unittestadapter/test_execution.py rename to python_files/tests/unittestadapter/test_execution.py diff --git a/pythonFiles/tests/unittestadapter/test_utils.py b/python_files/tests/unittestadapter/test_utils.py similarity index 100% rename from pythonFiles/tests/unittestadapter/test_utils.py rename to python_files/tests/unittestadapter/test_utils.py diff --git a/pythonFiles/tests/util.py b/python_files/tests/util.py similarity index 100% rename from pythonFiles/tests/util.py rename to python_files/tests/util.py diff --git a/pythonFiles/unittestadapter/__init__.py b/python_files/unittestadapter/__init__.py similarity index 100% rename from pythonFiles/unittestadapter/__init__.py rename to python_files/unittestadapter/__init__.py diff --git a/pythonFiles/unittestadapter/discovery.py b/python_files/unittestadapter/discovery.py similarity index 100% rename from pythonFiles/unittestadapter/discovery.py rename to python_files/unittestadapter/discovery.py diff --git a/pythonFiles/unittestadapter/execution.py b/python_files/unittestadapter/execution.py similarity index 100% rename from pythonFiles/unittestadapter/execution.py rename to python_files/unittestadapter/execution.py diff --git a/pythonFiles/unittestadapter/pvsc_utils.py b/python_files/unittestadapter/pvsc_utils.py similarity index 100% rename from pythonFiles/unittestadapter/pvsc_utils.py rename to python_files/unittestadapter/pvsc_utils.py diff --git a/pythonFiles/visualstudio_py_testlauncher.py b/python_files/visualstudio_py_testlauncher.py similarity index 100% rename from pythonFiles/visualstudio_py_testlauncher.py rename to python_files/visualstudio_py_testlauncher.py diff --git a/pythonFiles/vscode_datascience_helpers/tests/logParser.py b/python_files/vscode_datascience_helpers/tests/logParser.py similarity index 100% rename from pythonFiles/vscode_datascience_helpers/tests/logParser.py rename to python_files/vscode_datascience_helpers/tests/logParser.py diff --git a/pythonFiles/vscode_pytest/__init__.py b/python_files/vscode_pytest/__init__.py similarity index 100% rename from pythonFiles/vscode_pytest/__init__.py rename to python_files/vscode_pytest/__init__.py diff --git a/pythonFiles/vscode_pytest/run_pytest_script.py b/python_files/vscode_pytest/run_pytest_script.py similarity index 100% rename from pythonFiles/vscode_pytest/run_pytest_script.py rename to python_files/vscode_pytest/run_pytest_script.py diff --git a/src/client/activation/jedi/languageClientFactory.ts b/src/client/activation/jedi/languageClientFactory.ts index c3ef8d9623f3..70bd65da8d0d 100644 --- a/src/client/activation/jedi/languageClientFactory.ts +++ b/src/client/activation/jedi/languageClientFactory.ts @@ -21,7 +21,7 @@ export class JediLanguageClientFactory implements ILanguageClientFactory { clientOptions: LanguageClientOptions, ): Promise { // Just run the language server using a module - const lsScriptPath = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'run-jedi-language-server.py'); + const lsScriptPath = path.join(EXTENSION_ROOT_DIR, 'python_files', 'run-jedi-language-server.py'); const interpreter = await this.interpreterService.getActiveInterpreter(resource); const serverOptions: ServerOptions = { command: interpreter ? interpreter.path : 'python', diff --git a/src/client/activation/jedi/manager.ts b/src/client/activation/jedi/manager.ts index 672e9a1b33fd..bafdcc735a12 100644 --- a/src/client/activation/jedi/manager.ts +++ b/src/client/activation/jedi/manager.ts @@ -68,7 +68,7 @@ export class JediLanguageServerManager implements ILanguageServerManager { try { // Version is actually hardcoded in our requirements.txt. const requirementsTxt = await fs.readFile( - path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'jedilsp_requirements', 'requirements.txt'), + path.join(EXTENSION_ROOT_DIR, 'python_files', 'jedilsp_requirements', 'requirements.txt'), 'utf-8', ); diff --git a/src/client/api/types.ts b/src/client/api/types.ts index 4de554bf5a24..dccbd78f6f04 100644 --- a/src/client/api/types.ts +++ b/src/client/api/types.ts @@ -16,7 +16,7 @@ export interface PythonExtension { /** * Generate an array of strings for commands to pass to the Python executable to launch the debugger for remote debugging. * Users can append another array of strings of what they want to execute along with relevant arguments to Python. - * E.g `['/Users/..../pythonVSCode/pythonFiles/lib/python/debugpy', '--listen', 'localhost:57039', '--wait-for-client']` + * E.g `['/Users/..../pythonVSCode/python_files/lib/python/debugpy', '--listen', 'localhost:57039', '--wait-for-client']` * @param host * @param port * @param waitUntilDebuggerAttaches Defaults to `true`. diff --git a/src/client/common/process/internal/scripts/constants.ts b/src/client/common/process/internal/scripts/constants.ts index 4448f7e639ce..6954592ed3dd 100644 --- a/src/client/common/process/internal/scripts/constants.ts +++ b/src/client/common/process/internal/scripts/constants.ts @@ -5,4 +5,4 @@ import * as path from 'path'; import { EXTENSION_ROOT_DIR } from '../../../constants'; // It is simpler to hard-code it instead of using vscode.ExtensionContext.extensionPath. -export const _SCRIPTS_DIR = path.join(EXTENSION_ROOT_DIR, 'pythonFiles'); +export const _SCRIPTS_DIR = path.join(EXTENSION_ROOT_DIR, 'python_files'); diff --git a/src/client/common/process/internal/scripts/index.ts b/src/client/common/process/internal/scripts/index.ts index 2644fd0d00ff..f2c905c02889 100644 --- a/src/client/common/process/internal/scripts/index.ts +++ b/src/client/common/process/internal/scripts/index.ts @@ -7,7 +7,7 @@ import { _SCRIPTS_DIR } from './constants'; const SCRIPTS_DIR = _SCRIPTS_DIR; // "scripts" contains everything relevant to the scripts found under -// the top-level "pythonFiles" directory. Each of those scripts has +// the top-level "python_files" directory. Each of those scripts has // a function in this module which matches the script's filename. // Each function provides the commandline arguments that should be // used when invoking a Python executable, whether through spawn/exec @@ -18,7 +18,7 @@ const SCRIPTS_DIR = _SCRIPTS_DIR; // into the corresponding object or objects. "parse()" takes a single // string as the stdout text and returns the relevant data. // -// Some of the scripts are located in subdirectories of "pythonFiles". +// Some of the scripts are located in subdirectories of "python_files". // For each of those subdirectories there is a sub-module where // those scripts' functions may be found. // diff --git a/src/client/common/terminal/service.ts b/src/client/common/terminal/service.ts index cf63603a2e9b..c3b90181d563 100644 --- a/src/client/common/terminal/service.ts +++ b/src/client/common/terminal/service.ts @@ -31,7 +31,7 @@ export class TerminalService implements ITerminalService, Disposable { private terminalHelper: ITerminalHelper; private terminalActivator: ITerminalActivator; private terminalAutoActivator: ITerminalAutoActivation; - private readonly envVarScript = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'pythonrc.py'); + private readonly envVarScript = path.join(EXTENSION_ROOT_DIR, 'python_files', 'pythonrc.py'); public get onDidCloseTerminal(): Event { return this.terminalClosed.event.bind(this.terminalClosed); } diff --git a/src/client/debugger/extension/adapter/factory.ts b/src/client/debugger/extension/adapter/factory.ts index ecbd8afcc287..cfc8cf91aba3 100644 --- a/src/client/debugger/extension/adapter/factory.ts +++ b/src/client/debugger/extension/adapter/factory.ts @@ -93,7 +93,7 @@ export class DebugAdapterDescriptorFactory implements IDebugAdapterDescriptorFac const debuggerAdapterPathToUse = path.join( EXTENSION_ROOT_DIR, - 'pythonFiles', + 'python_files', 'lib', 'python', 'debugpy', diff --git a/src/client/debugger/extension/adapter/remoteLaunchers.ts b/src/client/debugger/extension/adapter/remoteLaunchers.ts index f42f101f8523..80e0289e3ad8 100644 --- a/src/client/debugger/extension/adapter/remoteLaunchers.ts +++ b/src/client/debugger/extension/adapter/remoteLaunchers.ts @@ -7,7 +7,7 @@ import * as path from 'path'; import { EXTENSION_ROOT_DIR } from '../../../common/constants'; import '../../../common/extensions'; -const pathToPythonLibDir = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'lib', 'python'); +const pathToPythonLibDir = path.join(EXTENSION_ROOT_DIR, 'python_files', 'lib', 'python'); const pathToDebugger = path.join(pathToPythonLibDir, 'debugpy'); type RemoteDebugOptions = { diff --git a/src/client/jupyter/jupyterIntegration.ts b/src/client/jupyter/jupyterIntegration.ts index 9faab6d2a763..a385248bff06 100644 --- a/src/client/jupyter/jupyterIntegration.ts +++ b/src/client/jupyter/jupyterIntegration.ts @@ -34,7 +34,7 @@ type PythonApiForJupyterExtension = { */ getSuggestions(resource: Resource): Promise; /** - * Returns path to where `debugpy` is. In python extension this is `/pythonFiles/lib/python`. + * Returns path to where `debugpy` is. In python extension this is `/python_files/lib/python`. */ getDebuggerPath(): Promise; /** diff --git a/src/client/testing/common/debugLauncher.ts b/src/client/testing/common/debugLauncher.ts index 85076461f22e..f05fa6bc9373 100644 --- a/src/client/testing/common/debugLauncher.ts +++ b/src/client/testing/common/debugLauncher.ts @@ -87,7 +87,7 @@ export class DebugLauncher implements ITestDebugLauncher { debugConfig.rules = []; } debugConfig.rules.push({ - path: path.join(EXTENSION_ROOT_DIR, 'pythonFiles'), + path: path.join(EXTENSION_ROOT_DIR, 'python_files'), include: false, }); @@ -219,7 +219,7 @@ export class DebugLauncher implements ITestDebugLauncher { ); } } - const pluginPath = path.join(EXTENSION_ROOT_DIR, 'pythonFiles'); + const pluginPath = path.join(EXTENSION_ROOT_DIR, 'python_files'); // check if PYTHONPATH is already set in the environment variables if (launchArgs.env) { const additionalPythonPath = [pluginPath]; diff --git a/src/client/testing/testController/common/types.ts b/src/client/testing/testController/common/types.ts index e51270eb4f9e..685f36af007a 100644 --- a/src/client/testing/testController/common/types.ts +++ b/src/client/testing/testController/common/types.ts @@ -228,7 +228,7 @@ export interface ITestExecutionAdapter { ): Promise; } -// Same types as in pythonFiles/unittestadapter/utils.py +// Same types as in python_files/unittestadapter/utils.py export type DiscoveredTestType = 'folder' | 'file' | 'class' | 'test'; export type DiscoveredTestCommon = { diff --git a/src/client/testing/testController/pytest/pytestDiscoveryAdapter.ts b/src/client/testing/testController/pytest/pytestDiscoveryAdapter.ts index ab44c96821e5..2d0dab765088 100644 --- a/src/client/testing/testController/pytest/pytestDiscoveryAdapter.ts +++ b/src/client/testing/testController/pytest/pytestDiscoveryAdapter.ts @@ -67,7 +67,7 @@ export class PytestTestDiscoveryAdapter implements ITestDiscoveryAdapter { } async runPytestDiscovery(uri: Uri, uuid: string, executionFactory?: IPythonExecutionFactory): Promise { - const relativePathToPytest = 'pythonFiles'; + const relativePathToPytest = 'python_files'; const fullPluginPath = path.join(EXTENSION_ROOT_DIR, relativePathToPytest); const settings = this.configSettings.getSettings(uri); let pytestArgsMap = argsToMap(settings.testing.pytestArgs); diff --git a/src/client/testing/testController/pytest/pytestExecutionAdapter.ts b/src/client/testing/testController/pytest/pytestExecutionAdapter.ts index d366bdfc9718..de519548d686 100644 --- a/src/client/testing/testController/pytest/pytestExecutionAdapter.ts +++ b/src/client/testing/testController/pytest/pytestExecutionAdapter.ts @@ -103,7 +103,7 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter { debugLauncher?: ITestDebugLauncher, deferredTillEOT?: Deferred, ): Promise { - const relativePathToPytest = 'pythonFiles'; + const relativePathToPytest = 'python_files'; const fullPluginPath = path.join(EXTENSION_ROOT_DIR, relativePathToPytest); const settings = this.configSettings.getSettings(uri); const { pytestArgs } = settings.testing; diff --git a/src/client/testing/testController/unittest/testDiscoveryAdapter.ts b/src/client/testing/testController/unittest/testDiscoveryAdapter.ts index 75e29afc9712..8cc44b3783c5 100644 --- a/src/client/testing/testController/unittest/testDiscoveryAdapter.ts +++ b/src/client/testing/testController/unittest/testDiscoveryAdapter.ts @@ -83,7 +83,7 @@ export class UnittestTestDiscoveryAdapter implements ITestDiscoveryAdapter { } function buildDiscoveryCommand(args: string[]): TestDiscoveryCommand { - const discoveryScript = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'unittestadapter', 'discovery.py'); + const discoveryScript = path.join(EXTENSION_ROOT_DIR, 'python_files', 'unittestadapter', 'discovery.py'); return { script: discoveryScript, diff --git a/src/client/testing/testController/unittest/testExecutionAdapter.ts b/src/client/testing/testController/unittest/testExecutionAdapter.ts index d90581a93110..85fd01f093a6 100644 --- a/src/client/testing/testController/unittest/testExecutionAdapter.ts +++ b/src/client/testing/testController/unittest/testExecutionAdapter.ts @@ -109,7 +109,7 @@ export class UnittestTestExecutionAdapter implements ITestExecutionAdapter { } function buildExecutionCommand(args: string[]): TestExecutionCommand { - const executionScript = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'unittestadapter', 'execution.py'); + const executionScript = path.join(EXTENSION_ROOT_DIR, 'python_files', 'unittestadapter', 'execution.py'); return { script: executionScript, diff --git a/src/test/api.functional.test.ts b/src/test/api.functional.test.ts index d99bcfde81ab..851d56c00e07 100644 --- a/src/test/api.functional.test.ts +++ b/src/test/api.functional.test.ts @@ -19,7 +19,7 @@ import { IServiceContainer, IServiceManager } from '../client/ioc/types'; import { IDiscoveryAPI } from '../client/pythonEnvironments/base/locator'; suite('Extension API', () => { - const debuggerPath = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'lib', 'python', 'debugpy'); + const debuggerPath = path.join(EXTENSION_ROOT_DIR, 'python_files', 'lib', 'python', 'debugpy'); const debuggerHost = 'somehost'; const debuggerPort = 12345; diff --git a/src/test/common.ts b/src/test/common.ts index 2ef366a3a472..bbf48f0e14c7 100644 --- a/src/test/common.ts +++ b/src/test/common.ts @@ -22,7 +22,7 @@ const StreamZip = require('node-stream-zip'); export { sleep } from './core'; -const fileInNonRootWorkspace = path.join(EXTENSION_ROOT_DIR_FOR_TESTS, 'src', 'test', 'pythonFiles', 'dummy.py'); +const fileInNonRootWorkspace = path.join(EXTENSION_ROOT_DIR_FOR_TESTS, 'src', 'test', 'python_files', 'dummy.py'); export const rootWorkspaceUri = getWorkspaceRoot(); export const PYTHON_PATH = getPythonPath(); diff --git a/src/test/common/terminals/service.unit.test.ts b/src/test/common/terminals/service.unit.test.ts index 7336f7094e6e..61556e3df2d1 100644 --- a/src/test/common/terminals/service.unit.test.ts +++ b/src/test/common/terminals/service.unit.test.ts @@ -170,7 +170,7 @@ suite('Terminal Service', () => { .setup((t) => t.createTerminal(TypeMoq.It.isAny())) .returns(() => terminal.object) .verifiable(TypeMoq.Times.atLeastOnce()); - const envVarScript = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'pythonrc.py'); + const envVarScript = path.join(EXTENSION_ROOT_DIR, 'python_files', 'pythonrc.py'); terminalManager .setup((t) => t.createTerminal({ diff --git a/src/test/common/terminals/synchronousTerminalService.unit.test.ts b/src/test/common/terminals/synchronousTerminalService.unit.test.ts index f74c529ef470..4b6e77ec8095 100644 --- a/src/test/common/terminals/synchronousTerminalService.unit.test.ts +++ b/src/test/common/terminals/synchronousTerminalService.unit.test.ts @@ -66,7 +66,7 @@ suite('Terminal Service (synchronous)', () => { }); }); suite('sendCommand', () => { - const shellExecFile = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'shell_exec.py'); + const shellExecFile = path.join(EXTENSION_ROOT_DIR, 'python_files', 'shell_exec.py'); test('run sendCommand in terminalService if there is no cancellation token', async () => { when(terminalService.sendCommand('cmd', deepEqual(['1', '2']))).thenResolve(); diff --git a/src/test/debugger/extension/adapter/adapter.test.ts b/src/test/debugger/extension/adapter/adapter.test.ts index 7e20d5b930b9..2f60290897af 100644 --- a/src/test/debugger/extension/adapter/adapter.test.ts +++ b/src/test/debugger/extension/adapter/adapter.test.ts @@ -19,7 +19,7 @@ function resolveWSFile(wsRoot: string, ...filePath: string[]): string { } suite('Debugger Integration', () => { - const file = resolveWSFile(WS_ROOT, 'pythonFiles', 'debugging', 'wait_for_file.py'); + const file = resolveWSFile(WS_ROOT, 'python_files', 'debugging', 'wait_for_file.py'); const doneFile = resolveWSFile(WS_ROOT, 'should-not-exist'); const outFile = resolveWSFile(WS_ROOT, 'output.txt'); const resource = vscode.Uri.file(file); diff --git a/src/test/debugger/extension/adapter/factory.unit.test.ts b/src/test/debugger/extension/adapter/factory.unit.test.ts index 5728bf0c34cd..172c2715b086 100644 --- a/src/test/debugger/extension/adapter/factory.unit.test.ts +++ b/src/test/debugger/extension/adapter/factory.unit.test.ts @@ -41,7 +41,7 @@ suite('Debugging - Adapter Factory', () => { let commandManager: ICommandManager; const nodeExecutable = undefined; - const debugAdapterPath = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'lib', 'python', 'debugpy', 'adapter'); + const debugAdapterPath = path.join(EXTENSION_ROOT_DIR, 'python_files', 'lib', 'python', 'debugpy', 'adapter'); const pythonPath = path.join('path', 'to', 'python', 'interpreter'); const interpreter = { architecture: Architecture.Unknown, diff --git a/src/test/debugger/extension/adapter/remoteLaunchers.unit.test.ts b/src/test/debugger/extension/adapter/remoteLaunchers.unit.test.ts index aa520f66faa6..2a75f6316a09 100644 --- a/src/test/debugger/extension/adapter/remoteLaunchers.unit.test.ts +++ b/src/test/debugger/extension/adapter/remoteLaunchers.unit.test.ts @@ -52,7 +52,7 @@ suite('External debugpy Debugger Launcher', () => { }); suite('Path To Debugger Package', () => { - const pathToPythonLibDir = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'lib', 'python'); + const pathToPythonLibDir = path.join(EXTENSION_ROOT_DIR, 'python_files', 'lib', 'python'); test('Path to debugpy debugger package', () => { const actual = launchers.getDebugpyPackagePath(); const expected = path.join(pathToPythonLibDir, 'debugpy'); diff --git a/src/test/initialize.ts b/src/test/initialize.ts index 487860410bf0..9c3f0ac387a7 100644 --- a/src/test/initialize.ts +++ b/src/test/initialize.ts @@ -14,7 +14,7 @@ import { sleep } from './core'; export * from './constants'; export * from './ciConstants'; -const dummyPythonFile = path.join(__dirname, '..', '..', 'src', 'test', 'pythonFiles', 'dummy.py'); +const dummyPythonFile = path.join(__dirname, '..', '..', 'src', 'test', 'python_files', 'dummy.py'); export const multirootPath = path.join(__dirname, '..', '..', 'src', 'testMultiRootWkspc'); const workspace3Uri = vscode.Uri.file(path.join(multirootPath, 'workspace3')); diff --git a/src/test/interpreters/activation/service.unit.test.ts b/src/test/interpreters/activation/service.unit.test.ts index 9b2c121c89b4..a0f9b3bd6915 100644 --- a/src/test/interpreters/activation/service.unit.test.ts +++ b/src/test/interpreters/activation/service.unit.test.ts @@ -161,7 +161,11 @@ suite('Interpreters Activation - Python Environment Variables', () => { const shellCmd = capture(processService.shellExec).first()[0]; - const printEnvPyFile = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'printEnvVariables.py'); + const printEnvPyFile = path.join( + EXTENSION_ROOT_DIR, + 'python_files', + 'printEnvVariables.py', + ); const expectedCommand = [ ...cmd, `echo '${getEnvironmentPrefix}'`, diff --git a/src/test/pythonEnvironments/info/interpreter.unit.test.ts b/src/test/pythonEnvironments/info/interpreter.unit.test.ts index 38a916d1db9b..967454dd6c7e 100644 --- a/src/test/pythonEnvironments/info/interpreter.unit.test.ts +++ b/src/test/pythonEnvironments/info/interpreter.unit.test.ts @@ -11,7 +11,7 @@ import { buildPythonExecInfo } from '../../../client/pythonEnvironments/exec'; import { getInterpreterInfo } from '../../../client/pythonEnvironments/info/interpreter'; import { EXTENSION_ROOT_DIR_FOR_TESTS } from '../../constants'; -const script = pathJoin(EXTENSION_ROOT_DIR_FOR_TESTS, 'pythonFiles', 'interpreterInfo.py'); +const script = pathJoin(EXTENSION_ROOT_DIR_FOR_TESTS, 'python_files', 'interpreterInfo.py'); suite('extractInterpreterInfo()', () => { // Tests go here. diff --git a/src/test/pythonFiles/formatting/autoPep8Formatted.py b/src/test/pythonFiles/formatting/autoPep8Formatted.py deleted file mode 100644 index e63158d6d4fd..000000000000 --- a/src/test/pythonFiles/formatting/autoPep8Formatted.py +++ /dev/null @@ -1,32 +0,0 @@ - -import math -import sys - - -def example1(): - # This is a long comment. This should be wrapped to fit within 72 characters. - some_tuple = (1, 2, 3, 'a') - some_variable = {'long': 'Long code lines should be wrapped within 79 characters.', - 'other': [math.pi, 100, 200, 300, 9876543210, 'This is a long string that goes on'], - 'more': {'inner': 'This whole logical line should be wrapped.', some_tuple: [1, - 20, 300, 40000, 500000000, 60000000000000000]}} - return (some_tuple, some_variable) - - -def example2(): return {'has_key() is deprecated': True}.has_key( - {'f': 2}.has_key('')) - - -class Example3(object): - def __init__(self, bar): - # Comments should have a space after the hash. - if bar: - bar += 1 - bar = bar * bar - return bar - else: - some_string = """ - Indentation in multiline strings should not be touched. -Only actual code should be reindented. -""" - return (sys.path, some_string) diff --git a/src/test/pythonFiles/formatting/autopep8.output b/src/test/pythonFiles/formatting/autopep8.output deleted file mode 100644 index 80cb3a445811..000000000000 --- a/src/test/pythonFiles/formatting/autopep8.output +++ /dev/null @@ -1,50 +0,0 @@ ---- original/C:\GIT\issues\s p\vscode-python\src\test\pythonFiles\formatting\fileToformat.py -+++ fixed/C:\GIT\issues\s p\vscode-python\src\test\pythonFiles\formatting\fileToformat.py -@@ -1,22 +1,32 @@ - --import math, sys; -+import math -+import sys -+ - - def example1(): -- ####This is a long comment. This should be wrapped to fit within 72 characters. -- some_tuple=( 1,2, 3,'a' ); -- some_variable={'long':'Long code lines should be wrapped within 79 characters.', -- 'other':[math.pi, 100,200,300,9876543210,'This is a long string that goes on'], -- 'more':{'inner':'This whole logical line should be wrapped.',some_tuple:[1, -- 20,300,40000,500000000,60000000000000000]}} -+ # This is a long comment. This should be wrapped to fit within 72 characters. -+ some_tuple = (1, 2, 3, 'a') -+ some_variable = {'long': 'Long code lines should be wrapped within 79 characters.', -+ 'other': [math.pi, 100, 200, 300, 9876543210, 'This is a long string that goes on'], -+ 'more': {'inner': 'This whole logical line should be wrapped.', some_tuple: [1, -+ 20, 300, 40000, 500000000, 60000000000000000]}} - return (some_tuple, some_variable) --def example2(): return {'has_key() is deprecated':True}.has_key({'f':2}.has_key('')); --class Example3( object ): -- def __init__ ( self, bar ): -- #Comments should have a space after the hash. -- if bar : bar+=1; bar=bar* bar ; return bar -- else: -- some_string = """ -+ -+ -+def example2(): return {'has_key() is deprecated': True}.has_key( -+ {'f': 2}.has_key('')) -+ -+ -+class Example3(object): -+ def __init__(self, bar): -+ # Comments should have a space after the hash. -+ if bar: -+ bar += 1 -+ bar = bar * bar -+ return bar -+ else: -+ some_string = """ - Indentation in multiline strings should not be touched. - Only actual code should be reindented. - """ -- return (sys.path, some_string) -+ return (sys.path, some_string) \ No newline at end of file diff --git a/src/test/pythonFiles/formatting/black.output b/src/test/pythonFiles/formatting/black.output deleted file mode 100644 index 4c14d61f2b9b..000000000000 --- a/src/test/pythonFiles/formatting/black.output +++ /dev/null @@ -1,59 +0,0 @@ ---- C:\GIT\issues\s p\vscode-python\src\test\pythonFiles\formatting\fileToformat.py 2020-05-11 18:56:39.835398 +0000 -+++ C:\GIT\issues\s p\vscode-python\src\test\pythonFiles\formatting\fileToformat.py 2020-05-11 19:05:50.969508 +0000 -@@ -1,23 +1,42 @@ -+import math, sys - --import math, sys; - - def example1(): - ####This is a long comment. This should be wrapped to fit within 72 characters. -- some_tuple=( 1,2, 3,'a' ); -- some_variable={'long':'Long code lines should be wrapped within 79 characters.', -- 'other':[math.pi, 100,200,300,9876543210,'This is a long string that goes on'], -- 'more':{'inner':'This whole logical line should be wrapped.',some_tuple:[1, -- 20,300,40000,500000000,60000000000000000]}} -+ some_tuple = (1, 2, 3, "a") -+ some_variable = { -+ "long": "Long code lines should be wrapped within 79 characters.", -+ "other": [ -+ math.pi, -+ 100, -+ 200, -+ 300, -+ 9876543210, -+ "This is a long string that goes on", -+ ], -+ "more": { -+ "inner": "This whole logical line should be wrapped.", -+ some_tuple: [1, 20, 300, 40000, 500000000, 60000000000000000], -+ }, -+ } - return (some_tuple, some_variable) --def example2(): return {'has_key() is deprecated':True}.has_key({'f':2}.has_key('')); --class Example3( object ): -- def __init__ ( self, bar ): -- #Comments should have a space after the hash. -- if bar : bar+=1; bar=bar* bar ; return bar -- else: -- some_string = """ -+ -+ -+def example2(): -+ return {"has_key() is deprecated": True}.has_key({"f": 2}.has_key("")) -+ -+ -+class Example3(object): -+ def __init__(self, bar): -+ # Comments should have a space after the hash. -+ if bar: -+ bar += 1 -+ bar = bar * bar -+ return bar -+ else: -+ some_string = """ - Indentation in multiline strings should not be touched. - Only actual code should be reindented. - """ -- return (sys.path, some_string) -+ return (sys.path, some_string) - \ No newline at end of file diff --git a/src/test/pythonFiles/formatting/blackFormatted.py b/src/test/pythonFiles/formatting/blackFormatted.py deleted file mode 100644 index e7bca8b1298c..000000000000 --- a/src/test/pythonFiles/formatting/blackFormatted.py +++ /dev/null @@ -1,41 +0,0 @@ -import math, sys - - -def example1(): - ####This is a long comment. This should be wrapped to fit within 72 characters. - some_tuple = (1, 2, 3, "a") - some_variable = { - "long": "Long code lines should be wrapped within 79 characters.", - "other": [ - math.pi, - 100, - 200, - 300, - 9876543210, - "This is a long string that goes on", - ], - "more": { - "inner": "This whole logical line should be wrapped.", - some_tuple: [1, 20, 300, 40000, 500000000, 60000000000000000], - }, - } - return (some_tuple, some_variable) - - -def example2(): - return {"has_key() is deprecated": True}.has_key({"f": 2}.has_key("")) - - -class Example3(object): - def __init__(self, bar): - # Comments should have a space after the hash. - if bar: - bar += 1 - bar = bar * bar - return bar - else: - some_string = """ - Indentation in multiline strings should not be touched. -Only actual code should be reindented. -""" - return (sys.path, some_string) diff --git a/src/test/pythonFiles/formatting/dummy.ts b/src/test/pythonFiles/formatting/dummy.ts deleted file mode 100644 index cbab6669e3b8..000000000000 --- a/src/test/pythonFiles/formatting/dummy.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Dummy ts file to ensure this folder gets created in output directory. - -// Code to ensure linter doesn't complain about empty files. -const a = '1'; diff --git a/src/test/pythonFiles/formatting/fileToFormat.py b/src/test/pythonFiles/formatting/fileToFormat.py deleted file mode 100644 index 5b544bd8504d..000000000000 --- a/src/test/pythonFiles/formatting/fileToFormat.py +++ /dev/null @@ -1,22 +0,0 @@ - -import math, sys; - -def example1(): - ####This is a long comment. This should be wrapped to fit within 72 characters. - some_tuple=( 1,2, 3,'a' ); - some_variable={'long':'Long code lines should be wrapped within 79 characters.', - 'other':[math.pi, 100,200,300,9876543210,'This is a long string that goes on'], - 'more':{'inner':'This whole logical line should be wrapped.',some_tuple:[1, - 20,300,40000,500000000,60000000000000000]}} - return (some_tuple, some_variable) -def example2(): return {'has_key() is deprecated':True}.has_key({'f':2}.has_key('')); -class Example3( object ): - def __init__ ( self, bar ): - #Comments should have a space after the hash. - if bar : bar+=1; bar=bar* bar ; return bar - else: - some_string = """ - Indentation in multiline strings should not be touched. -Only actual code should be reindented. -""" - return (sys.path, some_string) diff --git a/src/test/pythonFiles/formatting/fileToFormatOnEnter.py b/src/test/pythonFiles/formatting/fileToFormatOnEnter.py deleted file mode 100644 index 8adfd1fa1233..000000000000 --- a/src/test/pythonFiles/formatting/fileToFormatOnEnter.py +++ /dev/null @@ -1,13 +0,0 @@ -x=1 -"""x=1 -""" - # comment -# x=1 -x+1 # -@x -x.y -if x<=1: -if 1<=x: -def __init__(self, age = 23) -while(1) -x+""" diff --git a/src/test/pythonFiles/formatting/formatWhenDirty.py b/src/test/pythonFiles/formatting/formatWhenDirty.py deleted file mode 100644 index 3fe1b80fde86..000000000000 --- a/src/test/pythonFiles/formatting/formatWhenDirty.py +++ /dev/null @@ -1,3 +0,0 @@ -x = 0 -if x > 0: - x = 1 diff --git a/src/test/pythonFiles/formatting/formatWhenDirtyResult.py b/src/test/pythonFiles/formatting/formatWhenDirtyResult.py deleted file mode 100644 index d0ae06a2a59b..000000000000 --- a/src/test/pythonFiles/formatting/formatWhenDirtyResult.py +++ /dev/null @@ -1,3 +0,0 @@ -x = 0 -if x > 0: - x = 1 diff --git a/src/test/pythonFiles/formatting/pythonGrammar.py b/src/test/pythonFiles/formatting/pythonGrammar.py deleted file mode 100644 index 937cba401d3f..000000000000 --- a/src/test/pythonFiles/formatting/pythonGrammar.py +++ /dev/null @@ -1,1572 +0,0 @@ -# Python test set -- part 1, grammar. -# This just tests whether the parser accepts them all. - -from test.support import check_syntax_error -import inspect -import unittest -import sys -# testing import * -from sys import * - -# different import patterns to check that __annotations__ does not interfere -# with import machinery -import test.ann_module as ann_module -import typing -from collections import ChainMap -from test import ann_module2 -import test - -# These are shared with test_tokenize and other test modules. -# -# Note: since several test cases filter out floats by looking for "e" and ".", -# don't add hexadecimal literals that contain "e" or "E". -VALID_UNDERSCORE_LITERALS = [ - '0_0_0', - '4_2', - '1_0000_0000', - '0b1001_0100', - '0xffff_ffff', - '0o5_7_7', - '1_00_00.5', - '1_00_00.5e5', - '1_00_00e5_1', - '1e1_0', - '.1_4', - '.1_4e1', - '0b_0', - '0x_f', - '0o_5', - '1_00_00j', - '1_00_00.5j', - '1_00_00e5_1j', - '.1_4j', - '(1_2.5+3_3j)', - '(.5_6j)', -] -INVALID_UNDERSCORE_LITERALS = [ - # Trailing underscores: - '0_', - '42_', - '1.4j_', - '0x_', - '0b1_', - '0xf_', - '0o5_', - '0 if 1_Else 1', - # Underscores in the base selector: - '0_b0', - '0_xf', - '0_o5', - # Old-style octal, still disallowed: - '0_7', - '09_99', - # Multiple consecutive underscores: - '4_______2', - '0.1__4', - '0.1__4j', - '0b1001__0100', - '0xffff__ffff', - '0x___', - '0o5__77', - '1e1__0', - '1e1__0j', - # Underscore right before a dot: - '1_.4', - '1_.4j', - # Underscore right after a dot: - '1._4', - '1._4j', - '._5', - '._5j', - # Underscore right after a sign: - '1.0e+_1', - '1.0e+_1j', - # Underscore right before j: - '1.4_j', - '1.4e5_j', - # Underscore right before e: - '1_e1', - '1.4_e1', - '1.4_e1j', - # Underscore right after e: - '1e_1', - '1.4e_1', - '1.4e_1j', - # Complex cases with parens: - '(1+1.5_j_)', - '(1+1.5_j)', -] - - -class TokenTests(unittest.TestCase): - - def test_backslash(self): - # Backslash means line continuation: - x = 1 \ - + 1 - self.assertEqual(x, 2, 'backslash for line continuation') - - # Backslash does not means continuation in comments :\ - x = 0 - self.assertEqual(x, 0, 'backslash ending comment') - - def test_plain_integers(self): - self.assertEqual(type(000), type(0)) - self.assertEqual(0xff, 255) - self.assertEqual(0o377, 255) - self.assertEqual(2147483647, 0o17777777777) - self.assertEqual(0b1001, 9) - # "0x" is not a valid literal - self.assertRaises(SyntaxError, eval, "0x") - from sys import maxsize - if maxsize == 2147483647: - self.assertEqual(-2147483647 - 1, -0o20000000000) - # XXX -2147483648 - self.assertTrue(0o37777777777 > 0) - self.assertTrue(0xffffffff > 0) - self.assertTrue(0b1111111111111111111111111111111 > 0) - for s in ('2147483648', '0o40000000000', '0x100000000', - '0b10000000000000000000000000000000'): - try: - x = eval(s) - except OverflowError: - self.fail("OverflowError on huge integer literal %r" % s) - elif maxsize == 9223372036854775807: - self.assertEqual(-9223372036854775807 - 1, -0o1000000000000000000000) - self.assertTrue(0o1777777777777777777777 > 0) - self.assertTrue(0xffffffffffffffff > 0) - self.assertTrue(0b11111111111111111111111111111111111111111111111111111111111111 > 0) - for s in '9223372036854775808', '0o2000000000000000000000', \ - '0x10000000000000000', \ - '0b100000000000000000000000000000000000000000000000000000000000000': - try: - x = eval(s) - except OverflowError: - self.fail("OverflowError on huge integer literal %r" % s) - else: - self.fail('Weird maxsize value %r' % maxsize) - - def test_long_integers(self): - x = 0 - x = 0xffffffffffffffff - x = 0Xffffffffffffffff - x = 0o77777777777777777 - x = 0O77777777777777777 - x = 123456789012345678901234567890 - x = 0b100000000000000000000000000000000000000000000000000000000000000000000 - x = 0B111111111111111111111111111111111111111111111111111111111111111111111 - - def test_floats(self): - x = 3.14 - x = 314. - x = 0.314 - # XXX x = 000.314 - x = .314 - x = 3e14 - x = 3E14 - x = 3e-14 - x = 3e+14 - x = 3.e14 - x = .3e14 - x = 3.1e4 - - def test_float_exponent_tokenization(self): - # See issue 21642. - self.assertEqual(1 if 1 else 0, 1) - self.assertEqual(1 if 0 else 0, 0) - self.assertRaises(SyntaxError, eval, "0 if 1Else 0") - - def test_underscore_literals(self): - for lit in VALID_UNDERSCORE_LITERALS: - self.assertEqual(eval(lit), eval(lit.replace('_', ''))) - for lit in INVALID_UNDERSCORE_LITERALS: - self.assertRaises(SyntaxError, eval, lit) - # Sanity check: no literal begins with an underscore - self.assertRaises(NameError, eval, "_0") - - def test_string_literals(self): - x = ''; y = ""; self.assertTrue(len(x) == 0 and x == y) - x = '\''; y = "'"; self.assertTrue(len(x) == 1 and x == y and ord(x) == 39) - x = '"'; y = "\""; self.assertTrue(len(x) == 1 and x == y and ord(x) == 34) - x = "doesn't \"shrink\" does it" - y = 'doesn\'t "shrink" does it' - self.assertTrue(len(x) == 24 and x == y) - x = "does \"shrink\" doesn't it" - y = 'does "shrink" doesn\'t it' - self.assertTrue(len(x) == 24 and x == y) - x = """ -The "quick" -brown fox -jumps over -the 'lazy' dog. -""" - y = '\nThe "quick"\nbrown fox\njumps over\nthe \'lazy\' dog.\n' - self.assertEqual(x, y) - y = ''' -The "quick" -brown fox -jumps over -the 'lazy' dog. -''' - self.assertEqual(x, y) - y = "\n\ -The \"quick\"\n\ -brown fox\n\ -jumps over\n\ -the 'lazy' dog.\n\ -" - self.assertEqual(x, y) - y = '\n\ -The \"quick\"\n\ -brown fox\n\ -jumps over\n\ -the \'lazy\' dog.\n\ -' - self.assertEqual(x, y) - - def test_ellipsis(self): - x = ... - self.assertTrue(x is Ellipsis) - self.assertRaises(SyntaxError, eval, ".. .") - - def test_eof_error(self): - samples = ("def foo(", "\ndef foo(", "def foo(\n") - for s in samples: - with self.assertRaises(SyntaxError) as cm: - compile(s, "", "exec") - self.assertIn("unexpected EOF", str(cm.exception)) - -var_annot_global: int # a global annotated is necessary for test_var_annot - -# custom namespace for testing __annotations__ - -class CNS: - def __init__(self): - self._dct = {} - def __setitem__(self, item, value): - self._dct[item.lower()] = value - def __getitem__(self, item): - return self._dct[item] - - -class GrammarTests(unittest.TestCase): - - check_syntax_error = check_syntax_error - - # single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE - # XXX can't test in a script -- this rule is only used when interactive - - # file_input: (NEWLINE | stmt)* ENDMARKER - # Being tested as this very moment this very module - - # expr_input: testlist NEWLINE - # XXX Hard to test -- used only in calls to input() - - def test_eval_input(self): - # testlist ENDMARKER - x = eval('1, 0 or 1') - - def test_var_annot_basics(self): - # all these should be allowed - var1: int = 5 - var2: [int, str] - my_lst = [42] - def one(): - return 1 - int.new_attr: int - [list][0]: type - my_lst[one() - 1]: int = 5 - self.assertEqual(my_lst, [5]) - - def test_var_annot_syntax_errors(self): - # parser pass - check_syntax_error(self, "def f: int") - check_syntax_error(self, "x: int: str") - check_syntax_error(self, "def f():\n" - " nonlocal x: int\n") - # AST pass - check_syntax_error(self, "[x, 0]: int\n") - check_syntax_error(self, "f(): int\n") - check_syntax_error(self, "(x,): int") - check_syntax_error(self, "def f():\n" - " (x, y): int = (1, 2)\n") - # symtable pass - check_syntax_error(self, "def f():\n" - " x: int\n" - " global x\n") - check_syntax_error(self, "def f():\n" - " global x\n" - " x: int\n") - - def test_var_annot_basic_semantics(self): - # execution order - with self.assertRaises(ZeroDivisionError): - no_name[does_not_exist]: no_name_again = 1 / 0 - with self.assertRaises(NameError): - no_name[does_not_exist]: 1 / 0 = 0 - global var_annot_global - - # function semantics - def f(): - st: str = "Hello" - a.b: int = (1, 2) - return st - self.assertEqual(f.__annotations__, {}) - def f_OK(): - x: 1 / 0 - f_OK() - def fbad(): - x: int - print(x) - with self.assertRaises(UnboundLocalError): - fbad() - def f2bad(): - (no_such_global): int - print(no_such_global) - try: - f2bad() - except Exception as e: - self.assertIs(type(e), NameError) - - # class semantics - class C: - __foo: int - s: str = "attr" - z = 2 - def __init__(self, x): - self.x: int = x - self.assertEqual(C.__annotations__, {'_C__foo': int, 's': str}) - with self.assertRaises(NameError): - class CBad: - no_such_name_defined.attr: int = 0 - with self.assertRaises(NameError): - class Cbad2(C): - x: int - x.y: list = [] - - def test_var_annot_metaclass_semantics(self): - class CMeta(type): - @classmethod - def __prepare__(metacls, name, bases, **kwds): - return {'__annotations__': CNS()} - class CC(metaclass=CMeta): - XX: 'ANNOT' - self.assertEqual(CC.__annotations__['xx'], 'ANNOT') - - def test_var_annot_module_semantics(self): - with self.assertRaises(AttributeError): - print(test.__annotations__) - self.assertEqual(ann_module.__annotations__, - {1: 2, 'x': int, 'y': str, 'f': typing.Tuple[int, int]}) - self.assertEqual(ann_module.M.__annotations__, - {'123': 123, 'o': type}) - self.assertEqual(ann_module2.__annotations__, {}) - - def test_var_annot_in_module(self): - # check that functions fail the same way when executed - # outside of module where they were defined - from test.ann_module3 import f_bad_ann, g_bad_ann, D_bad_ann - with self.assertRaises(NameError): - f_bad_ann() - with self.assertRaises(NameError): - g_bad_ann() - with self.assertRaises(NameError): - D_bad_ann(5) - - def test_var_annot_simple_exec(self): - gns = {}; lns = {} - exec("'docstring'\n" - "__annotations__[1] = 2\n" - "x: int = 5\n", gns, lns) - self.assertEqual(lns["__annotations__"], {1: 2, 'x': int}) - with self.assertRaises(KeyError): - gns['__annotations__'] - - def test_var_annot_custom_maps(self): - # tests with custom locals() and __annotations__ - ns = {'__annotations__': CNS()} - exec('X: int; Z: str = "Z"; (w): complex = 1j', ns) - self.assertEqual(ns['__annotations__']['x'], int) - self.assertEqual(ns['__annotations__']['z'], str) - with self.assertRaises(KeyError): - ns['__annotations__']['w'] - nonloc_ns = {} - class CNS2: - def __init__(self): - self._dct = {} - def __setitem__(self, item, value): - nonlocal nonloc_ns - self._dct[item] = value - nonloc_ns[item] = value - def __getitem__(self, item): - return self._dct[item] - exec('x: int = 1', {}, CNS2()) - self.assertEqual(nonloc_ns['__annotations__']['x'], int) - - def test_var_annot_refleak(self): - # complex case: custom locals plus custom __annotations__ - # this was causing refleak - cns = CNS() - nonloc_ns = {'__annotations__': cns} - class CNS2: - def __init__(self): - self._dct = {'__annotations__': cns} - def __setitem__(self, item, value): - nonlocal nonloc_ns - self._dct[item] = value - nonloc_ns[item] = value - def __getitem__(self, item): - return self._dct[item] - exec('X: str', {}, CNS2()) - self.assertEqual(nonloc_ns['__annotations__']['x'], str) - - def test_funcdef(self): - ### [decorators] 'def' NAME parameters ['->' test] ':' suite - ### decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE - ### decorators: decorator+ - ### parameters: '(' [typedargslist] ')' - ### typedargslist: ((tfpdef ['=' test] ',')* - ### ('*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef) - ### | tfpdef ['=' test] (',' tfpdef ['=' test])* [',']) - ### tfpdef: NAME [':' test] - ### varargslist: ((vfpdef ['=' test] ',')* - ### ('*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef) - ### | vfpdef ['=' test] (',' vfpdef ['=' test])* [',']) - ### vfpdef: NAME - def f1(): pass - f1() - f1(*()) - f1(*(), **{}) - def f2(one_argument): pass - def f3(two, arguments): pass - self.assertEqual(f2.__code__.co_varnames, ('one_argument',)) - self.assertEqual(f3.__code__.co_varnames, ('two', 'arguments')) - def a1(one_arg,): pass - def a2(two, args,): pass - def v0(*rest): pass - def v1(a, *rest): pass - def v2(a, b, *rest): pass - - f1() - f2(1) - f2(1,) - f3(1, 2) - f3(1, 2,) - v0() - v0(1) - v0(1,) - v0(1, 2) - v0(1, 2, 3, 4, 5, 6, 7, 8, 9, 0) - v1(1) - v1(1,) - v1(1, 2) - v1(1, 2, 3) - v1(1, 2, 3, 4, 5, 6, 7, 8, 9, 0) - v2(1, 2) - v2(1, 2, 3) - v2(1, 2, 3, 4) - v2(1, 2, 3, 4, 5, 6, 7, 8, 9, 0) - - def d01(a=1): pass - d01() - d01(1) - d01(*(1,)) - d01(*[] or [2]) - d01(*() or (), *{} and (), **() or {}) - d01(**{'a': 2}) - d01(**{'a': 2} or {}) - def d11(a, b=1): pass - d11(1) - d11(1, 2) - d11(1, **{'b': 2}) - def d21(a, b, c=1): pass - d21(1, 2) - d21(1, 2, 3) - d21(*(1, 2, 3)) - d21(1, *(2, 3)) - d21(1, 2, *(3,)) - d21(1, 2, **{'c': 3}) - def d02(a=1, b=2): pass - d02() - d02(1) - d02(1, 2) - d02(*(1, 2)) - d02(1, *(2,)) - d02(1, **{'b': 2}) - d02(**{'a': 1, 'b': 2}) - def d12(a, b=1, c=2): pass - d12(1) - d12(1, 2) - d12(1, 2, 3) - def d22(a, b, c=1, d=2): pass - d22(1, 2) - d22(1, 2, 3) - d22(1, 2, 3, 4) - def d01v(a=1, *rest): pass - d01v() - d01v(1) - d01v(1, 2) - d01v(*(1, 2, 3, 4)) - d01v(*(1,)) - d01v(**{'a': 2}) - def d11v(a, b=1, *rest): pass - d11v(1) - d11v(1, 2) - d11v(1, 2, 3) - def d21v(a, b, c=1, *rest): pass - d21v(1, 2) - d21v(1, 2, 3) - d21v(1, 2, 3, 4) - d21v(*(1, 2, 3, 4)) - d21v(1, 2, **{'c': 3}) - def d02v(a=1, b=2, *rest): pass - d02v() - d02v(1) - d02v(1, 2) - d02v(1, 2, 3) - d02v(1, *(2, 3, 4)) - d02v(**{'a': 1, 'b': 2}) - def d12v(a, b=1, c=2, *rest): pass - d12v(1) - d12v(1, 2) - d12v(1, 2, 3) - d12v(1, 2, 3, 4) - d12v(*(1, 2, 3, 4)) - d12v(1, 2, *(3, 4, 5)) - d12v(1, *(2,), **{'c': 3}) - def d22v(a, b, c=1, d=2, *rest): pass - d22v(1, 2) - d22v(1, 2, 3) - d22v(1, 2, 3, 4) - d22v(1, 2, 3, 4, 5) - d22v(*(1, 2, 3, 4)) - d22v(1, 2, *(3, 4, 5)) - d22v(1, *(2, 3), **{'d': 4}) - - # keyword argument type tests - try: - str('x', **{b'foo': 1}) - except TypeError: - pass - else: - self.fail('Bytes should not work as keyword argument names') - # keyword only argument tests - def pos0key1(*, key): return key - pos0key1(key=100) - def pos2key2(p1, p2, *, k1, k2=100): return p1, p2, k1, k2 - pos2key2(1, 2, k1=100) - pos2key2(1, 2, k1=100, k2=200) - pos2key2(1, 2, k2=100, k1=200) - def pos2key2dict(p1, p2, *, k1=100, k2, **kwarg): return p1, p2, k1, k2, kwarg - pos2key2dict(1, 2, k2=100, tokwarg1=100, tokwarg2=200) - pos2key2dict(1, 2, tokwarg1=100, tokwarg2=200, k2=100) - - self.assertRaises(SyntaxError, eval, "def f(*): pass") - self.assertRaises(SyntaxError, eval, "def f(*,): pass") - self.assertRaises(SyntaxError, eval, "def f(*, **kwds): pass") - - # keyword arguments after *arglist - def f(*args, **kwargs): - return args, kwargs - self.assertEqual(f(1, x=2, *[3, 4], y=5), ((1, 3, 4), - {'x': 2, 'y': 5})) - self.assertEqual(f(1, *(2, 3), 4), ((1, 2, 3, 4), {})) - self.assertRaises(SyntaxError, eval, "f(1, x=2, *(3,4), x=5)") - self.assertEqual(f(**{'eggs': 'scrambled', 'spam': 'fried'}), - ((), {'eggs': 'scrambled', 'spam': 'fried'})) - self.assertEqual(f(spam='fried', **{'eggs': 'scrambled'}), - ((), {'eggs': 'scrambled', 'spam': 'fried'})) - - # Check ast errors in *args and *kwargs - check_syntax_error(self, "f(*g(1=2))") - check_syntax_error(self, "f(**g(1=2))") - - # argument annotation tests - def f(x) -> list: pass - self.assertEqual(f.__annotations__, {'return': list}) - def f(x: int): pass - self.assertEqual(f.__annotations__, {'x': int}) - def f(*x: str): pass - self.assertEqual(f.__annotations__, {'x': str}) - def f(**x: float): pass - self.assertEqual(f.__annotations__, {'x': float}) - def f(x, y: 1 + 2): pass - self.assertEqual(f.__annotations__, {'y': 3}) - def f(a, b: 1, c: 2, d): pass - self.assertEqual(f.__annotations__, {'b': 1, 'c': 2}) - def f(a, b: 1, c: 2, d, e: 3 = 4, f=5, *g: 6): pass - self.assertEqual(f.__annotations__, - {'b': 1, 'c': 2, 'e': 3, 'g': 6}) - def f(a, b: 1, c: 2, d, e: 3 = 4, f=5, *g: 6, h: 7, i=8, j: 9 = 10, - **k: 11) -> 12: pass - self.assertEqual(f.__annotations__, - {'b': 1, 'c': 2, 'e': 3, 'g': 6, 'h': 7, 'j': 9, - 'k': 11, 'return': 12}) - # Check for issue #20625 -- annotations mangling - class Spam: - def f(self, *, __kw: 1): - pass - class Ham(Spam): pass - self.assertEqual(Spam.f.__annotations__, {'_Spam__kw': 1}) - self.assertEqual(Ham.f.__annotations__, {'_Spam__kw': 1}) - # Check for SF Bug #1697248 - mixing decorators and a return annotation - def null(x): return x - @null - def f(x) -> list: pass - self.assertEqual(f.__annotations__, {'return': list}) - - # test closures with a variety of opargs - closure = 1 - def f(): return closure - def f(x=1): return closure - def f(*, k=1): return closure - def f() -> int: return closure - - # Check trailing commas are permitted in funcdef argument list - def f(a,): pass - def f(*args,): pass - def f(**kwds,): pass - def f(a, *args,): pass - def f(a, **kwds,): pass - def f(*args, b,): pass - def f(*, b,): pass - def f(*args, **kwds,): pass - def f(a, *args, b,): pass - def f(a, *, b,): pass - def f(a, *args, **kwds,): pass - def f(*args, b, **kwds,): pass - def f(*, b, **kwds,): pass - def f(a, *args, b, **kwds,): pass - def f(a, *, b, **kwds,): pass - - def test_lambdef(self): - ### lambdef: 'lambda' [varargslist] ':' test - l1 = lambda: 0 - self.assertEqual(l1(), 0) - l2 = lambda: a[d] # XXX just testing the expression - l3 = lambda: [2 < x for x in [-1, 3, 0]] - self.assertEqual(l3(), [0, 1, 0]) - l4 = lambda x=lambda y=lambda z=1: z: y(): x() - self.assertEqual(l4(), 1) - l5 = lambda x, y, z=2: x + y + z - self.assertEqual(l5(1, 2), 5) - self.assertEqual(l5(1, 2, 3), 6) - check_syntax_error(self, "lambda x: x = 2") - check_syntax_error(self, "lambda (None,): None") - l6 = lambda x, y, *, k=20: x + y + k - self.assertEqual(l6(1, 2), 1 + 2 + 20) - self.assertEqual(l6(1, 2, k=10), 1 + 2 + 10) - - # check that trailing commas are permitted - l10 = lambda a,: 0 - l11 = lambda *args,: 0 - l12 = lambda **kwds,: 0 - l13 = lambda a, *args,: 0 - l14 = lambda a, **kwds,: 0 - l15 = lambda *args, b,: 0 - l16 = lambda *, b,: 0 - l17 = lambda *args, **kwds,: 0 - l18 = lambda a, *args, b,: 0 - l19 = lambda a, *, b,: 0 - l20 = lambda a, *args, **kwds,: 0 - l21 = lambda *args, b, **kwds,: 0 - l22 = lambda *, b, **kwds,: 0 - l23 = lambda a, *args, b, **kwds,: 0 - l24 = lambda a, *, b, **kwds,: 0 - - - ### stmt: simple_stmt | compound_stmt - # Tested below - - def test_simple_stmt(self): - ### simple_stmt: small_stmt (';' small_stmt)* [';'] - x = 1; pass; del x - def foo(): - # verify statements that end with semi-colons - x = 1; pass; del x; - foo() - - ### small_stmt: expr_stmt | pass_stmt | del_stmt | flow_stmt | import_stmt | global_stmt | access_stmt - # Tested below - - def test_expr_stmt(self): - # (exprlist '=')* exprlist - 1 - 1, 2, 3 - x = 1 - x = 1, 2, 3 - x = y = z = 1, 2, 3 - x, y, z = 1, 2, 3 - abc = a, b, c = x, y, z = xyz = 1, 2, (3, 4) - - check_syntax_error(self, "x + 1 = 1") - check_syntax_error(self, "a + 1 = b + 2") - - # Check the heuristic for print & exec covers significant cases - # As well as placing some limits on false positives - def test_former_statements_refer_to_builtins(self): - keywords = "print", "exec" - # Cases where we want the custom error - cases = [ - "{} foo", - "{} {{1:foo}}", - "if 1: {} foo", - "if 1: {} {{1:foo}}", - "if 1:\n {} foo", - "if 1:\n {} {{1:foo}}", - ] - for keyword in keywords: - custom_msg = "call to '{}'".format(keyword) - for case in cases: - source = case.format(keyword) - with self.subTest(source=source): - with self.assertRaisesRegex(SyntaxError, custom_msg): - exec(source) - source = source.replace("foo", "(foo.)") - with self.subTest(source=source): - with self.assertRaisesRegex(SyntaxError, "invalid syntax"): - exec(source) - - def test_del_stmt(self): - # 'del' exprlist - abc = [1, 2, 3] - x, y, z = abc - xyz = x, y, z - - del abc - del x, y, (z, xyz) - - def test_pass_stmt(self): - # 'pass' - pass - - # flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt - # Tested below - - def test_break_stmt(self): - # 'break' - while 1: break - - def test_continue_stmt(self): - # 'continue' - i = 1 - while i: i = 0; continue - - msg = "" - while not msg: - msg = "ok" - try: - continue - msg = "continue failed to continue inside try" - except: - msg = "continue inside try called except block" - if msg != "ok": - self.fail(msg) - - msg = "" - while not msg: - msg = "finally block not called" - try: - continue - finally: - msg = "ok" - if msg != "ok": - self.fail(msg) - - def test_break_continue_loop(self): - # This test warrants an explanation. It is a test specifically for SF bugs - # #463359 and #462937. The bug is that a 'break' statement executed or - # exception raised inside a try/except inside a loop, *after* a continue - # statement has been executed in that loop, will cause the wrong number of - # arguments to be popped off the stack and the instruction pointer reset to - # a very small number (usually 0.) Because of this, the following test - # *must* written as a function, and the tracking vars *must* be function - # arguments with default values. Otherwise, the test will loop and loop. - - def test_inner(extra_burning_oil=1, count=0): - big_hippo = 2 - while big_hippo: - count += 1 - try: - if extra_burning_oil and big_hippo == 1: - extra_burning_oil -= 1 - break - big_hippo -= 1 - continue - except: - raise - if count > 2 or big_hippo != 1: - self.fail("continue then break in try/except in loop broken!") - test_inner() - - def test_return(self): - # 'return' [testlist] - def g1(): return - def g2(): return 1 - g1() - x = g2() - check_syntax_error(self, "class foo:return 1") - - def test_break_in_finally(self): - count = 0 - while count < 2: - count += 1 - try: - pass - finally: - break - self.assertEqual(count, 1) - - count = 0 - while count < 2: - count += 1 - try: - continue - finally: - break - self.assertEqual(count, 1) - - count = 0 - while count < 2: - count += 1 - try: - 1 / 0 - finally: - break - self.assertEqual(count, 1) - - for count in [0, 1]: - self.assertEqual(count, 0) - try: - pass - finally: - break - self.assertEqual(count, 0) - - for count in [0, 1]: - self.assertEqual(count, 0) - try: - continue - finally: - break - self.assertEqual(count, 0) - - for count in [0, 1]: - self.assertEqual(count, 0) - try: - 1 / 0 - finally: - break - self.assertEqual(count, 0) - - def test_continue_in_finally(self): - count = 0 - while count < 2: - count += 1 - try: - pass - finally: - continue - break - self.assertEqual(count, 2) - - count = 0 - while count < 2: - count += 1 - try: - break - finally: - continue - self.assertEqual(count, 2) - - count = 0 - while count < 2: - count += 1 - try: - 1 / 0 - finally: - continue - break - self.assertEqual(count, 2) - - for count in [0, 1]: - try: - pass - finally: - continue - break - self.assertEqual(count, 1) - - for count in [0, 1]: - try: - break - finally: - continue - self.assertEqual(count, 1) - - for count in [0, 1]: - try: - 1 / 0 - finally: - continue - break - self.assertEqual(count, 1) - - def test_return_in_finally(self): - def g1(): - try: - pass - finally: - return 1 - self.assertEqual(g1(), 1) - - def g2(): - try: - return 2 - finally: - return 3 - self.assertEqual(g2(), 3) - - def g3(): - try: - 1 / 0 - finally: - return 4 - self.assertEqual(g3(), 4) - - def test_yield(self): - # Allowed as standalone statement - def g(): yield 1 - def g(): yield from () - # Allowed as RHS of assignment - def g(): x = yield 1 - def g(): x = yield from () - # Ordinary yield accepts implicit tuples - def g(): yield 1, 1 - def g(): x = yield 1, 1 - # 'yield from' does not - check_syntax_error(self, "def g(): yield from (), 1") - check_syntax_error(self, "def g(): x = yield from (), 1") - # Requires parentheses as subexpression - def g(): 1, (yield 1) - def g(): 1, (yield from ()) - check_syntax_error(self, "def g(): 1, yield 1") - check_syntax_error(self, "def g(): 1, yield from ()") - # Requires parentheses as call argument - def g(): f((yield 1)) - def g(): f((yield 1), 1) - def g(): f((yield from ())) - def g(): f((yield from ()), 1) - check_syntax_error(self, "def g(): f(yield 1)") - check_syntax_error(self, "def g(): f(yield 1, 1)") - check_syntax_error(self, "def g(): f(yield from ())") - check_syntax_error(self, "def g(): f(yield from (), 1)") - # Not allowed at top level - check_syntax_error(self, "yield") - check_syntax_error(self, "yield from") - # Not allowed at class scope - check_syntax_error(self, "class foo:yield 1") - check_syntax_error(self, "class foo:yield from ()") - # Check annotation refleak on SyntaxError - check_syntax_error(self, "def g(a:(yield)): pass") - - def test_yield_in_comprehensions(self): - # Check yield in comprehensions - def g(): [x for x in [(yield 1)]] - def g(): [x for x in [(yield from ())]] - - check = self.check_syntax_error - check("def g(): [(yield x) for x in ()]", - "'yield' inside list comprehension") - check("def g(): [x for x in () if not (yield x)]", - "'yield' inside list comprehension") - check("def g(): [y for x in () for y in [(yield x)]]", - "'yield' inside list comprehension") - check("def g(): {(yield x) for x in ()}", - "'yield' inside set comprehension") - check("def g(): {(yield x): x for x in ()}", - "'yield' inside dict comprehension") - check("def g(): {x: (yield x) for x in ()}", - "'yield' inside dict comprehension") - check("def g(): ((yield x) for x in ())", - "'yield' inside generator expression") - check("def g(): [(yield from x) for x in ()]", - "'yield' inside list comprehension") - check("class C: [(yield x) for x in ()]", - "'yield' inside list comprehension") - check("[(yield x) for x in ()]", - "'yield' inside list comprehension") - - def test_raise(self): - # 'raise' test [',' test] - try: raise RuntimeError('just testing') - except RuntimeError: pass - try: raise KeyboardInterrupt - except KeyboardInterrupt: pass - - def test_import(self): - # 'import' dotted_as_names - import sys - import time, sys - # 'from' dotted_name 'import' ('*' | '(' import_as_names ')' | import_as_names) - from time import time - from time import (time) - # not testable inside a function, but already done at top of the module - # from sys import * - from sys import path, argv - from sys import (path, argv) - from sys import (path, argv,) - - def test_global(self): - # 'global' NAME (',' NAME)* - global a - global a, b - global one, two, three, four, five, six, seven, eight, nine, ten - - def test_nonlocal(self): - # 'nonlocal' NAME (',' NAME)* - x = 0 - y = 0 - def f(): - nonlocal x - nonlocal x, y - - def test_assert(self): - # assertTruestmt: 'assert' test [',' test] - assert 1 - assert 1, 1 - assert lambda x: x - assert 1, lambda x: x + 1 - - try: - assert True - except AssertionError as e: - self.fail("'assert True' should not have raised an AssertionError") - - try: - assert True, 'this should always pass' - except AssertionError as e: - self.fail("'assert True, msg' should not have " - "raised an AssertionError") - - # these tests fail if python is run with -O, so check __debug__ - @unittest.skipUnless(__debug__, "Won't work if __debug__ is False") - def testAssert2(self): - try: - assert 0, "msg" - except AssertionError as e: - self.assertEqual(e.args[0], "msg") - else: - self.fail("AssertionError not raised by assert 0") - - try: - assert False - except AssertionError as e: - self.assertEqual(len(e.args), 0) - else: - self.fail("AssertionError not raised by 'assert False'") - - - ### compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | funcdef | classdef - # Tested below - - def test_if(self): - # 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] - if 1: pass - if 1: pass - else: pass - if 0: pass - elif 0: pass - if 0: pass - elif 0: pass - elif 0: pass - elif 0: pass - else: pass - - def test_while(self): - # 'while' test ':' suite ['else' ':' suite] - while 0: pass - while 0: pass - else: pass - - # Issue1920: "while 0" is optimized away, - # ensure that the "else" clause is still present. - x = 0 - while 0: - x = 1 - else: - x = 2 - self.assertEqual(x, 2) - - def test_for(self): - # 'for' exprlist 'in' exprlist ':' suite ['else' ':' suite] - for i in 1, 2, 3: pass - for i, j, k in (): pass - else: pass - class Squares: - def __init__(self, max): - self.max = max - self.sofar = [] - def __len__(self): return len(self.sofar) - def __getitem__(self, i): - if not 0 <= i < self.max: raise IndexError - n = len(self.sofar) - while n <= i: - self.sofar.append(n * n) - n = n + 1 - return self.sofar[i] - n = 0 - for x in Squares(10): n = n + x - if n != 285: - self.fail('for over growing sequence') - - result = [] - for x, in [(1,), (2,), (3,)]: - result.append(x) - self.assertEqual(result, [1, 2, 3]) - - def test_try(self): - ### try_stmt: 'try' ':' suite (except_clause ':' suite)+ ['else' ':' suite] - ### | 'try' ':' suite 'finally' ':' suite - ### except_clause: 'except' [expr ['as' expr]] - try: - 1 / 0 - except ZeroDivisionError: - pass - else: - pass - try: 1 / 0 - except EOFError: pass - except TypeError as msg: pass - except: pass - else: pass - try: 1 / 0 - except (EOFError, TypeError, ZeroDivisionError): pass - try: 1 / 0 - except (EOFError, TypeError, ZeroDivisionError) as msg: pass - try: pass - finally: pass - - def test_suite(self): - # simple_stmt | NEWLINE INDENT NEWLINE* (stmt NEWLINE*)+ DEDENT - if 1: pass - if 1: - pass - if 1: - # - # - # - pass - pass - # - pass - # - - def test_test(self): - ### and_test ('or' and_test)* - ### and_test: not_test ('and' not_test)* - ### not_test: 'not' not_test | comparison - if not 1: pass - if 1 and 1: pass - if 1 or 1: pass - if not not not 1: pass - if not 1 and 1 and 1: pass - if 1 and 1 or 1 and 1 and 1 or not 1 and 1: pass - - def test_comparison(self): - ### comparison: expr (comp_op expr)* - ### comp_op: '<'|'>'|'=='|'>='|'<='|'!='|'in'|'not' 'in'|'is'|'is' 'not' - if 1: pass - x = (1 == 1) - if 1 == 1: pass - if 1 != 1: pass - if 1 < 1: pass - if 1 > 1: pass - if 1 <= 1: pass - if 1 >= 1: pass - if 1 is 1: pass - if 1 is not 1: pass - if 1 in (): pass - if 1 not in (): pass - if 1 < 1 > 1 == 1 >= 1 <= 1 != 1 in 1 not in 1 is 1 is not 1: pass - - def test_binary_mask_ops(self): - x = 1 & 1 - x = 1 ^ 1 - x = 1 | 1 - - def test_shift_ops(self): - x = 1 << 1 - x = 1 >> 1 - x = 1 << 1 >> 1 - - def test_additive_ops(self): - x = 1 - x = 1 + 1 - x = 1 - 1 - 1 - x = 1 - 1 + 1 - 1 + 1 - - def test_multiplicative_ops(self): - x = 1 * 1 - x = 1 / 1 - x = 1 % 1 - x = 1 / 1 * 1 % 1 - - def test_unary_ops(self): - x = +1 - x = -1 - x = ~1 - x = ~1 ^ 1 & 1 | 1 & 1 ^ -1 - x = -1 * 1 / 1 + 1 * 1 - -1 * 1 - - def test_selectors(self): - ### trailer: '(' [testlist] ')' | '[' subscript ']' | '.' NAME - ### subscript: expr | [expr] ':' [expr] - - import sys, time - c = sys.path[0] - x = time.time() - x = sys.modules['time'].time() - a = '01234' - c = a[0] - c = a[-1] - s = a[0:5] - s = a[:5] - s = a[0:] - s = a[:] - s = a[-5:] - s = a[:-1] - s = a[-4:-3] - # A rough test of SF bug 1333982. http://python.org/sf/1333982 - # The testing here is fairly incomplete. - # Test cases should include: commas with 1 and 2 colons - d = {} - d[1] = 1 - d[1,] = 2 - d[1, 2] = 3 - d[1, 2, 3] = 4 - L = list(d) - L.sort(key=lambda x: (type(x).__name__, x)) - self.assertEqual(str(L), '[1, (1,), (1, 2), (1, 2, 3)]') - - def test_atoms(self): - ### atom: '(' [testlist] ')' | '[' [testlist] ']' | '{' [dictsetmaker] '}' | NAME | NUMBER | STRING - ### dictsetmaker: (test ':' test (',' test ':' test)* [',']) | (test (',' test)* [',']) - - x = (1) - x = (1 or 2 or 3) - x = (1 or 2 or 3, 2, 3) - - x = [] - x = [1] - x = [1 or 2 or 3] - x = [1 or 2 or 3, 2, 3] - x = [] - - x = {} - x = {'one': 1} - x = {'one': 1,} - x = {'one' or 'two': 1 or 2} - x = {'one': 1, 'two': 2} - x = {'one': 1, 'two': 2,} - x = {'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5, 'six': 6} - - x = {'one'} - x = {'one', 1,} - x = {'one', 'two', 'three'} - x = {2, 3, 4,} - - x = x - x = 'x' - x = 123 - - ### exprlist: expr (',' expr)* [','] - ### testlist: test (',' test)* [','] - # These have been exercised enough above - - def test_classdef(self): - # 'class' NAME ['(' [testlist] ')'] ':' suite - class B: pass - class B2(): pass - class C1(B): pass - class C2(B): pass - class D(C1, C2, B): pass - class C: - def meth1(self): pass - def meth2(self, arg): pass - def meth3(self, a1, a2): pass - - # decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE - # decorators: decorator+ - # decorated: decorators (classdef | funcdef) - def class_decorator(x): return x - @class_decorator - class G: pass - - def test_dictcomps(self): - # dictorsetmaker: ( (test ':' test (comp_for | - # (',' test ':' test)* [','])) | - # (test (comp_for | (',' test)* [','])) ) - nums = [1, 2, 3] - self.assertEqual({i: i + 1 for i in nums}, {1: 2, 2: 3, 3: 4}) - - def test_listcomps(self): - # list comprehension tests - nums = [1, 2, 3, 4, 5] - strs = ["Apple", "Banana", "Coconut"] - spcs = [" Apple", " Banana ", "Coco nut "] - - self.assertEqual([s.strip() for s in spcs], ['Apple', 'Banana', 'Coco nut']) - self.assertEqual([3 * x for x in nums], [3, 6, 9, 12, 15]) - self.assertEqual([x for x in nums if x > 2], [3, 4, 5]) - self.assertEqual([(i, s) for i in nums for s in strs], - [(1, 'Apple'), (1, 'Banana'), (1, 'Coconut'), - (2, 'Apple'), (2, 'Banana'), (2, 'Coconut'), - (3, 'Apple'), (3, 'Banana'), (3, 'Coconut'), - (4, 'Apple'), (4, 'Banana'), (4, 'Coconut'), - (5, 'Apple'), (5, 'Banana'), (5, 'Coconut')]) - self.assertEqual([(i, s) for i in nums for s in [f for f in strs if "n" in f]], - [(1, 'Banana'), (1, 'Coconut'), (2, 'Banana'), (2, 'Coconut'), - (3, 'Banana'), (3, 'Coconut'), (4, 'Banana'), (4, 'Coconut'), - (5, 'Banana'), (5, 'Coconut')]) - self.assertEqual([(lambda a:[a ** i for i in range(a + 1)])(j) for j in range(5)], - [[1], [1, 1], [1, 2, 4], [1, 3, 9, 27], [1, 4, 16, 64, 256]]) - - def test_in_func(l): - return [0 < x < 3 for x in l if x > 2] - - self.assertEqual(test_in_func(nums), [False, False, False]) - - def test_nested_front(): - self.assertEqual([[y for y in [x, x + 1]] for x in [1, 3, 5]], - [[1, 2], [3, 4], [5, 6]]) - - test_nested_front() - - check_syntax_error(self, "[i, s for i in nums for s in strs]") - check_syntax_error(self, "[x if y]") - - suppliers = [ - (1, "Boeing"), - (2, "Ford"), - (3, "Macdonalds") - ] - - parts = [ - (10, "Airliner"), - (20, "Engine"), - (30, "Cheeseburger") - ] - - suppart = [ - (1, 10), (1, 20), (2, 20), (3, 30) - ] - - x = [ - (sname, pname) - for (sno, sname) in suppliers - for (pno, pname) in parts - for (sp_sno, sp_pno) in suppart - if sno == sp_sno and pno == sp_pno - ] - - self.assertEqual(x, [('Boeing', 'Airliner'), ('Boeing', 'Engine'), ('Ford', 'Engine'), - ('Macdonalds', 'Cheeseburger')]) - - def test_genexps(self): - # generator expression tests - g = ([x for x in range(10)] for x in range(1)) - self.assertEqual(next(g), [x for x in range(10)]) - try: - next(g) - self.fail('should produce StopIteration exception') - except StopIteration: - pass - - a = 1 - try: - g = (a for d in a) - next(g) - self.fail('should produce TypeError') - except TypeError: - pass - - self.assertEqual(list((x, y) for x in 'abcd' for y in 'abcd'), [(x, y) for x in 'abcd' for y in 'abcd']) - self.assertEqual(list((x, y) for x in 'ab' for y in 'xy'), [(x, y) for x in 'ab' for y in 'xy']) - - a = [x for x in range(10)] - b = (x for x in (y for y in a)) - self.assertEqual(sum(b), sum([x for x in range(10)])) - - self.assertEqual(sum(x ** 2 for x in range(10)), sum([x ** 2 for x in range(10)])) - self.assertEqual(sum(x * x for x in range(10) if x % 2), sum([x * x for x in range(10) if x % 2])) - self.assertEqual(sum(x for x in (y for y in range(10))), sum([x for x in range(10)])) - self.assertEqual(sum(x for x in (y for y in (z for z in range(10)))), sum([x for x in range(10)])) - self.assertEqual(sum(x for x in [y for y in (z for z in range(10))]), sum([x for x in range(10)])) - self.assertEqual(sum(x for x in (y for y in (z for z in range(10) if True)) if True), sum([x for x in range(10)])) - self.assertEqual(sum(x for x in (y for y in (z for z in range(10) if True) if False) if True), 0) - check_syntax_error(self, "foo(x for x in range(10), 100)") - check_syntax_error(self, "foo(100, x for x in range(10))") - - def test_comprehension_specials(self): - # test for outmost iterable precomputation - x = 10; g = (i for i in range(x)); x = 5 - self.assertEqual(len(list(g)), 10) - - # This should hold, since we're only precomputing outmost iterable. - x = 10; t = False; g = ((i, j) for i in range(x) if t for j in range(x)) - x = 5; t = True; - self.assertEqual([(i, j) for i in range(10) for j in range(5)], list(g)) - - # Grammar allows multiple adjacent 'if's in listcomps and genexps, - # even though it's silly. Make sure it works (ifelse broke this.) - self.assertEqual([x for x in range(10) if x % 2 if x % 3], [1, 5, 7]) - self.assertEqual(list(x for x in range(10) if x % 2 if x % 3), [1, 5, 7]) - - # verify unpacking single element tuples in listcomp/genexp. - self.assertEqual([x for x, in [(4,), (5,), (6,)]], [4, 5, 6]) - self.assertEqual(list(x for x, in [(7,), (8,), (9,)]), [7, 8, 9]) - - def test_with_statement(self): - class manager(object): - def __enter__(self): - return (1, 2) - def __exit__(self, *args): - pass - - with manager(): - pass - with manager() as x: - pass - with manager() as (x, y): - pass - with manager(), manager(): - pass - with manager() as x, manager() as y: - pass - with manager() as x, manager(): - pass - - def test_if_else_expr(self): - # Test ifelse expressions in various cases - def _checkeval(msg, ret): - "helper to check that evaluation of expressions is done correctly" - print(msg) - return ret - - # the next line is not allowed anymore - #self.assertEqual([ x() for x in lambda: True, lambda: False if x() ], [True]) - self.assertEqual([x() for x in (lambda:True, lambda:False) if x()], [True]) - self.assertEqual([x(False) for x in (lambda x:False if x else True, lambda x:True if x else False) if x(False)], [True]) - self.assertEqual((5 if 1 else _checkeval("check 1", 0)), 5) - self.assertEqual((_checkeval("check 2", 0) if 0 else 5), 5) - self.assertEqual((5 and 6 if 0 else 1), 1) - self.assertEqual(((5 and 6) if 0 else 1), 1) - self.assertEqual((5 and (6 if 1 else 1)), 6) - self.assertEqual((0 or _checkeval("check 3", 2) if 0 else 3), 3) - self.assertEqual((1 or _checkeval("check 4", 2) if 1 else _checkeval("check 5", 3)), 1) - self.assertEqual((0 or 5 if 1 else _checkeval("check 6", 3)), 5) - self.assertEqual((not 5 if 1 else 1), False) - self.assertEqual((not 5 if 0 else 1), 1) - self.assertEqual((6 + 1 if 1 else 2), 7) - self.assertEqual((6 - 1 if 1 else 2), 5) - self.assertEqual((6 * 2 if 1 else 4), 12) - self.assertEqual((6 / 2 if 1 else 3), 3) - self.assertEqual((6 < 4 if 0 else 2), 2) - - def test_paren_evaluation(self): - self.assertEqual(16 // (4 // 2), 8) - self.assertEqual((16 // 4) // 2, 2) - self.assertEqual(16 // 4 // 2, 2) - self.assertTrue(False is (2 is 3)) - self.assertFalse((False is 2) is 3) - self.assertFalse(False is 2 is 3) - - def test_matrix_mul(self): - # This is not intended to be a comprehensive test, rather just to be few - # samples of the @ operator in test_grammar.py. - class M: - def __matmul__(self, o): - return 4 - def __imatmul__(self, o): - self.other = o - return self - m = M() - self.assertEqual(m @ m, 4) - m @= 42 - self.assertEqual(m.other, 42) - - def test_async_await(self): - async def test(): - def sum(): - pass - if 1: - await someobj() - - self.assertEqual(test.__name__, 'test') - self.assertTrue(bool(test.__code__.co_flags & inspect.CO_COROUTINE)) - - def decorator(func): - setattr(func, '_marked', True) - return func - - @decorator - async def test2(): - return 22 - self.assertTrue(test2._marked) - self.assertEqual(test2.__name__, 'test2') - self.assertTrue(bool(test2.__code__.co_flags & inspect.CO_COROUTINE)) - - def test_async_for(self): - class Done(Exception): pass - - class AIter: - def __aiter__(self): - return self - async def __anext__(self): - raise StopAsyncIteration - - async def foo(): - async for i in AIter(): - pass - async for i, j in AIter(): - pass - async for i in AIter(): - pass - else: - pass - raise Done - - with self.assertRaises(Done): - foo().send(None) - - def test_async_with(self): - class Done(Exception): pass - - class manager: - async def __aenter__(self): - return (1, 2) - async def __aexit__(self, *exc): - return False - - async def foo(): - async with manager(): - pass - async with manager() as x: - pass - async with manager() as (x, y): - pass - async with manager(), manager(): - pass - async with manager() as x, manager() as y: - pass - async with manager() as x, manager(): - pass - raise Done - - with self.assertRaises(Done): - foo().send(None) - - -if __name__ == '__main__': - unittest.main() diff --git a/src/test/pythonFiles/formatting/yapf.output b/src/test/pythonFiles/formatting/yapf.output deleted file mode 100644 index 43897b1753b0..000000000000 --- a/src/test/pythonFiles/formatting/yapf.output +++ /dev/null @@ -1,57 +0,0 @@ ---- C:\GIT\issues\s p\vscode-python\src\test\pythonFiles\formatting\fileToformat.py (original) -+++ C:\GIT\issues\s p\vscode-python\src\test\pythonFiles\formatting\fileToformat.py (reformatted) -@@ -1,22 +1,40 @@ -+import math, sys - --import math, sys; - - def example1(): - ####This is a long comment. This should be wrapped to fit within 72 characters. -- some_tuple=( 1,2, 3,'a' ); -- some_variable={'long':'Long code lines should be wrapped within 79 characters.', -- 'other':[math.pi, 100,200,300,9876543210,'This is a long string that goes on'], -- 'more':{'inner':'This whole logical line should be wrapped.',some_tuple:[1, -- 20,300,40000,500000000,60000000000000000]}} -+ some_tuple = (1, 2, 3, 'a') -+ some_variable = { -+ 'long': -+ 'Long code lines should be wrapped within 79 characters.', -+ 'other': [ -+ math.pi, 100, 200, 300, 9876543210, -+ 'This is a long string that goes on' -+ ], -+ 'more': { -+ 'inner': 'This whole logical line should be wrapped.', -+ some_tuple: [1, 20, 300, 40000, 500000000, 60000000000000000] -+ } -+ } - return (some_tuple, some_variable) --def example2(): return {'has_key() is deprecated':True}.has_key({'f':2}.has_key('')); --class Example3( object ): -- def __init__ ( self, bar ): -- #Comments should have a space after the hash. -- if bar : bar+=1; bar=bar* bar ; return bar -- else: -- some_string = """ -+ -+ -+def example2(): -+ return { -+ 'has_key() is deprecated': True -+ }.has_key({'f': 2}.has_key('')) -+ -+ -+class Example3(object): -+ def __init__(self, bar): -+ #Comments should have a space after the hash. -+ if bar: -+ bar += 1 -+ bar = bar * bar -+ return bar -+ else: -+ some_string = """ - Indentation in multiline strings should not be touched. - Only actual code should be reindented. - """ -- return (sys.path, some_string) -+ return (sys.path, some_string) diff --git a/src/test/pythonFiles/formatting/yapfFormatted.py b/src/test/pythonFiles/formatting/yapfFormatted.py deleted file mode 100644 index aa3b079379a2..000000000000 --- a/src/test/pythonFiles/formatting/yapfFormatted.py +++ /dev/null @@ -1,40 +0,0 @@ -import math, sys - - -def example1(): - ####This is a long comment. This should be wrapped to fit within 72 characters. - some_tuple = (1, 2, 3, 'a') - some_variable = { - 'long': - 'Long code lines should be wrapped within 79 characters.', - 'other': [ - math.pi, 100, 200, 300, 9876543210, - 'This is a long string that goes on' - ], - 'more': { - 'inner': 'This whole logical line should be wrapped.', - some_tuple: [1, 20, 300, 40000, 500000000, 60000000000000000] - } - } - return (some_tuple, some_variable) - - -def example2(): - return { - 'has_key() is deprecated': True - }.has_key({'f': 2}.has_key('')) - - -class Example3(object): - def __init__(self, bar): - #Comments should have a space after the hash. - if bar: - bar += 1 - bar = bar * bar - return bar - else: - some_string = """ - Indentation in multiline strings should not be touched. -Only actual code should be reindented. -""" - return (sys.path, some_string) diff --git a/src/test/pythonFiles/linting/cwd/.pylintrc b/src/test/pythonFiles/linting/cwd/.pylintrc deleted file mode 100644 index 8530187c095f..000000000000 --- a/src/test/pythonFiles/linting/cwd/.pylintrc +++ /dev/null @@ -1,2 +0,0 @@ -[MESSAGES CONTROL] -disable=C0326,I0011,I0012,C0304,C0103,W0613,E0001,E1101 diff --git a/src/test/pythonFiles/linting/file.py b/src/test/pythonFiles/linting/file.py deleted file mode 100644 index 7b625a769243..000000000000 --- a/src/test/pythonFiles/linting/file.py +++ /dev/null @@ -1,87 +0,0 @@ -"""pylint option block-disable""" - -__revision__ = None - -class Foo(object): - """block-disable test""" - - def __init__(self): - pass - - def meth1(self, arg): - """this issues a message""" - print (self) - - def meth2(self, arg): - """and this one not""" - # pylint: disable=unused-argument - print (self\ - + "foo") - - def meth3(self): - """test one line disabling""" - # no error - print (self.bla) # pylint: disable=no-member - # error - print (self.blop) - - def meth4(self): - """test re-enabling""" - # pylint: disable=no-member - # no error - print (self.bla) - print (self.blop) - # pylint: enable=no-member - # error - print (self.blip) - - def meth5(self): - """test IF sub-block re-enabling""" - # pylint: disable=no-member - # no error - print (self.bla) - if self.blop: - # pylint: enable=no-member - # error - print (self.blip) - else: - # no error - print (self.blip) - # no error - print (self.blip) - - def meth6(self): - """test TRY/EXCEPT sub-block re-enabling""" - # pylint: disable=no-member - # no error - print (self.bla) - try: - # pylint: enable=no-member - # error - print (self.blip) - except UndefinedName: # pylint: disable=undefined-variable - # no error - print (self.blip) - # no error - print (self.blip) - - def meth7(self): - """test one line block opening disabling""" - if self.blop: # pylint: disable=no-member - # error - print (self.blip) - else: - # error - print (self.blip) - # error - print (self.blip) - - - def meth8(self): - """test late disabling""" - # error - print (self.blip) - # pylint: disable=no-member - # no error - print (self.bla) - print (self.blop) diff --git a/src/test/pythonFiles/linting/flake8config/.flake8 b/src/test/pythonFiles/linting/flake8config/.flake8 deleted file mode 100644 index 99ff2b9f819c..000000000000 --- a/src/test/pythonFiles/linting/flake8config/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore = E302,E901,E127,E261,E261,E261,E303 \ No newline at end of file diff --git a/src/test/pythonFiles/linting/flake8config/file.py b/src/test/pythonFiles/linting/flake8config/file.py deleted file mode 100644 index 9abe4993dddd..000000000000 --- a/src/test/pythonFiles/linting/flake8config/file.py +++ /dev/null @@ -1,86 +0,0 @@ -"""pylint option block-disable""" - -__revision__ = None - - -class Foo(object): - """block-disable test""" - - def __init__(self): - pass - - def meth1(self, arg): - """this issues a message""" - print(self) - - def meth2(self, arg): - """and this one not""" - # pylint: disable=unused-argument - print(self + "foo") - - def meth3(self): - """test one line disabling""" - # no error - print(self.bla) # pylint: disable=no-member - # error - print(self.blop) - - def meth4(self): - """test re-enabling""" - # pylint: disable=no-member - # no error - print(self.bla) - print(self.blop) - # pylint: enable=no-member - # error - print(self.blip) - - def meth5(self): - """test IF sub-block re-enabling""" - # pylint: disable=no-member - # no error - print(self.bla) - if self.blop: - # pylint: enable=no-member - # error - print(self.blip) - else: - # no error - print(self.blip) - # no error - print(self.blip) - - def meth6(self): - """test TRY/EXCEPT sub-block re-enabling""" - # pylint: disable=no-member - # no error - print(self.bla) - try: - # pylint: enable=no-member - # error - print(self.blip) - except UndefinedName: # pylint: disable=undefined-variable - # no error - print(self.blip) - # no error - print(self.blip) - - def meth7(self): - """test one line block opening disabling""" - if self.blop: # pylint: disable=no-member - # error - print(self.blip) - else: - # error - print(self.blip) - # error - print(self.blip) - - def meth8(self): - """test late disabling""" - # error - print(self.blip) - # pylint: disable=no-member - # no error - print(self.bla) - print(self.blop) diff --git a/src/test/pythonFiles/linting/minCheck.py b/src/test/pythonFiles/linting/minCheck.py deleted file mode 100644 index d93fa56f7e8a..000000000000 --- a/src/test/pythonFiles/linting/minCheck.py +++ /dev/null @@ -1 +0,0 @@ -filter(lambda x: x == 1, [1, 1, 2]) diff --git a/src/test/pythonFiles/linting/print.py b/src/test/pythonFiles/linting/print.py deleted file mode 100644 index fca61311fc84..000000000000 --- a/src/test/pythonFiles/linting/print.py +++ /dev/null @@ -1 +0,0 @@ -print x \ No newline at end of file diff --git a/src/test/pythonFiles/linting/pycodestyleconfig/.pycodestyle b/src/test/pythonFiles/linting/pycodestyleconfig/.pycodestyle deleted file mode 100644 index b7c78f49db84..000000000000 --- a/src/test/pythonFiles/linting/pycodestyleconfig/.pycodestyle +++ /dev/null @@ -1,2 +0,0 @@ -[pycodestyle] -ignore = E302,E901,E127,E261,E261,E261,E303 diff --git a/src/test/pythonFiles/linting/pycodestyleconfig/file.py b/src/test/pythonFiles/linting/pycodestyleconfig/file.py deleted file mode 100644 index 047ba0dc679e..000000000000 --- a/src/test/pythonFiles/linting/pycodestyleconfig/file.py +++ /dev/null @@ -1,87 +0,0 @@ -"""pylint option block-disable""" - -__revision__ = None - -class Foo(object): - """block-disable test""" - - def __init__(self): - pass - - def meth1(self, arg): - """this issues a message""" - print self - - def meth2(self, arg): - """and this one not""" - # pylint: disable=unused-argument - print self\ - + "foo" - - def meth3(self): - """test one line disabling""" - # no error - print self.bla # pylint: disable=no-member - # error - print self.blop - - def meth4(self): - """test re-enabling""" - # pylint: disable=no-member - # no error - print self.bla - print self.blop - # pylint: enable=no-member - # error - print self.blip - - def meth5(self): - """test IF sub-block re-enabling""" - # pylint: disable=no-member - # no error - print self.bla - if self.blop: - # pylint: enable=no-member - # error - print self.blip - else: - # no error - print self.blip - # no error - print self.blip - - def meth6(self): - """test TRY/EXCEPT sub-block re-enabling""" - # pylint: disable=no-member - # no error - print self.bla - try: - # pylint: enable=no-member - # error - print self.blip - except UndefinedName: # pylint: disable=undefined-variable - # no error - print self.blip - # no error - print self.blip - - def meth7(self): - """test one line block opening disabling""" - if self.blop: # pylint: disable=no-member - # error - print self.blip - else: - # error - print self.blip - # error - print self.blip - - - def meth8(self): - """test late disabling""" - # error - print self.blip - # pylint: disable=no-member - # no error - print self.bla - print self.blop \ No newline at end of file diff --git a/src/test/pythonFiles/linting/pydocstyleconfig27/.pydocstyle b/src/test/pythonFiles/linting/pydocstyleconfig27/.pydocstyle deleted file mode 100644 index 19020834ad32..000000000000 --- a/src/test/pythonFiles/linting/pydocstyleconfig27/.pydocstyle +++ /dev/null @@ -1,2 +0,0 @@ -[pydocstyle] -ignore=D400,D401,D402,D403,D404,D203,D102,D107 diff --git a/src/test/pythonFiles/linting/pydocstyleconfig27/file.py b/src/test/pythonFiles/linting/pydocstyleconfig27/file.py deleted file mode 100644 index 047ba0dc679e..000000000000 --- a/src/test/pythonFiles/linting/pydocstyleconfig27/file.py +++ /dev/null @@ -1,87 +0,0 @@ -"""pylint option block-disable""" - -__revision__ = None - -class Foo(object): - """block-disable test""" - - def __init__(self): - pass - - def meth1(self, arg): - """this issues a message""" - print self - - def meth2(self, arg): - """and this one not""" - # pylint: disable=unused-argument - print self\ - + "foo" - - def meth3(self): - """test one line disabling""" - # no error - print self.bla # pylint: disable=no-member - # error - print self.blop - - def meth4(self): - """test re-enabling""" - # pylint: disable=no-member - # no error - print self.bla - print self.blop - # pylint: enable=no-member - # error - print self.blip - - def meth5(self): - """test IF sub-block re-enabling""" - # pylint: disable=no-member - # no error - print self.bla - if self.blop: - # pylint: enable=no-member - # error - print self.blip - else: - # no error - print self.blip - # no error - print self.blip - - def meth6(self): - """test TRY/EXCEPT sub-block re-enabling""" - # pylint: disable=no-member - # no error - print self.bla - try: - # pylint: enable=no-member - # error - print self.blip - except UndefinedName: # pylint: disable=undefined-variable - # no error - print self.blip - # no error - print self.blip - - def meth7(self): - """test one line block opening disabling""" - if self.blop: # pylint: disable=no-member - # error - print self.blip - else: - # error - print self.blip - # error - print self.blip - - - def meth8(self): - """test late disabling""" - # error - print self.blip - # pylint: disable=no-member - # no error - print self.bla - print self.blop \ No newline at end of file diff --git a/src/test/pythonFiles/linting/pylintconfig/.pylintrc b/src/test/pythonFiles/linting/pylintconfig/.pylintrc deleted file mode 100644 index 74ea19101f81..000000000000 --- a/src/test/pythonFiles/linting/pylintconfig/.pylintrc +++ /dev/null @@ -1,2 +0,0 @@ -[MESSAGES CONTROL] -disable=I0011,C0304,C0103,W0613,E0001,E1101 diff --git a/src/test/pythonFiles/linting/pylintconfig/file.py b/src/test/pythonFiles/linting/pylintconfig/file.py deleted file mode 100644 index 047ba0dc679e..000000000000 --- a/src/test/pythonFiles/linting/pylintconfig/file.py +++ /dev/null @@ -1,87 +0,0 @@ -"""pylint option block-disable""" - -__revision__ = None - -class Foo(object): - """block-disable test""" - - def __init__(self): - pass - - def meth1(self, arg): - """this issues a message""" - print self - - def meth2(self, arg): - """and this one not""" - # pylint: disable=unused-argument - print self\ - + "foo" - - def meth3(self): - """test one line disabling""" - # no error - print self.bla # pylint: disable=no-member - # error - print self.blop - - def meth4(self): - """test re-enabling""" - # pylint: disable=no-member - # no error - print self.bla - print self.blop - # pylint: enable=no-member - # error - print self.blip - - def meth5(self): - """test IF sub-block re-enabling""" - # pylint: disable=no-member - # no error - print self.bla - if self.blop: - # pylint: enable=no-member - # error - print self.blip - else: - # no error - print self.blip - # no error - print self.blip - - def meth6(self): - """test TRY/EXCEPT sub-block re-enabling""" - # pylint: disable=no-member - # no error - print self.bla - try: - # pylint: enable=no-member - # error - print self.blip - except UndefinedName: # pylint: disable=undefined-variable - # no error - print self.blip - # no error - print self.blip - - def meth7(self): - """test one line block opening disabling""" - if self.blop: # pylint: disable=no-member - # error - print self.blip - else: - # error - print self.blip - # error - print self.blip - - - def meth8(self): - """test late disabling""" - # error - print self.blip - # pylint: disable=no-member - # no error - print self.bla - print self.blop \ No newline at end of file diff --git a/src/test/pythonFiles/linting/pylintconfig/file2.py b/src/test/pythonFiles/linting/pylintconfig/file2.py deleted file mode 100644 index f375c984aa2e..000000000000 --- a/src/test/pythonFiles/linting/pylintconfig/file2.py +++ /dev/null @@ -1,19 +0,0 @@ -"""pylint option block-disable""" - -__revision__ = None - -class Foo(object): - """block-disable test""" - - def __init__(self): - pass - - def meth1(self, arg): - """meth1""" - print self.blop - - def meth2(self, arg): - """meth2""" - # pylint: disable=unused-argument - print self\ - + "foo" diff --git a/src/test/pythonFiles/linting/threeLineLints.py b/src/test/pythonFiles/linting/threeLineLints.py deleted file mode 100644 index e8b578d93f11..000000000000 --- a/src/test/pythonFiles/linting/threeLineLints.py +++ /dev/null @@ -1,24 +0,0 @@ -"""pylint messages with three lines of output""" - -__revision__ = None - -class Foo(object): - - def __init__(self): - pass - - def meth1(self,arg): - """missing a space between 'self' and 'arg'. This should trigger the - following three line lint warning:: - - C: 10, 0: Exactly one space required after comma - def meth1(self,arg): - ^ (bad-whitespace) - - The following three lines of tuples should also cause three-line lint - errors due to "Exactly one space required after comma" messages. - """ - a = (1,2) - b = (1,2) - c = (1,2) - print (self) diff --git a/src/test/pythonFiles/refactoring/source folder/.vscode/.ropeproject/config.py b/src/test/pythonFiles/refactoring/source folder/.vscode/.ropeproject/config.py deleted file mode 100644 index dee2d1ae9a6b..000000000000 --- a/src/test/pythonFiles/refactoring/source folder/.vscode/.ropeproject/config.py +++ /dev/null @@ -1,114 +0,0 @@ -# The default ``config.py`` -# flake8: noqa - - -def set_prefs(prefs): - """This function is called before opening the project""" - - # Specify which files and folders to ignore in the project. - # Changes to ignored resources are not added to the history and - # VCSs. Also they are not returned in `Project.get_files()`. - # Note that ``?`` and ``*`` match all characters but slashes. - # '*.pyc': matches 'test.pyc' and 'pkg/test.pyc' - # 'mod*.pyc': matches 'test/mod1.pyc' but not 'mod/1.pyc' - # '.svn': matches 'pkg/.svn' and all of its children - # 'build/*.o': matches 'build/lib.o' but not 'build/sub/lib.o' - # 'build//*.o': matches 'build/lib.o' and 'build/sub/lib.o' - prefs['ignored_resources'] = ['*.pyc', '*~', '.ropeproject', - '.hg', '.svn', '_svn', '.git', '.tox'] - - # Specifies which files should be considered python files. It is - # useful when you have scripts inside your project. Only files - # ending with ``.py`` are considered to be python files by - # default. - # prefs['python_files'] = ['*.py'] - - # Custom source folders: By default rope searches the project - # for finding source folders (folders that should be searched - # for finding modules). You can add paths to that list. Note - # that rope guesses project source folders correctly most of the - # time; use this if you have any problems. - # The folders should be relative to project root and use '/' for - # separating folders regardless of the platform rope is running on. - # 'src/my_source_folder' for instance. - # prefs.add('source_folders', 'src') - - # You can extend python path for looking up modules - # prefs.add('python_path', '~/python/') - - # Should rope save object information or not. - prefs['save_objectdb'] = True - prefs['compress_objectdb'] = False - - # If `True`, rope analyzes each module when it is being saved. - prefs['automatic_soa'] = True - # The depth of calls to follow in static object analysis - prefs['soa_followed_calls'] = 0 - - # If `False` when running modules or unit tests "dynamic object - # analysis" is turned off. This makes them much faster. - prefs['perform_doa'] = True - - # Rope can check the validity of its object DB when running. - prefs['validate_objectdb'] = True - - # How many undos to hold? - prefs['max_history_items'] = 32 - - # Shows whether to save history across sessions. - prefs['save_history'] = True - prefs['compress_history'] = False - - # Set the number spaces used for indenting. According to - # :PEP:`8`, it is best to use 4 spaces. Since most of rope's - # unit-tests use 4 spaces it is more reliable, too. - prefs['indent_size'] = 4 - - # Builtin and c-extension modules that are allowed to be imported - # and inspected by rope. - prefs['extension_modules'] = [] - - # Add all standard c-extensions to extension_modules list. - prefs['import_dynload_stdmods'] = True - - # If `True` modules with syntax errors are considered to be empty. - # The default value is `False`; When `False` syntax errors raise - # `rope.base.exceptions.ModuleSyntaxError` exception. - prefs['ignore_syntax_errors'] = False - - # If `True`, rope ignores unresolvable imports. Otherwise, they - # appear in the importing namespace. - prefs['ignore_bad_imports'] = False - - # If `True`, rope will insert new module imports as - # `from import ` by default. - prefs['prefer_module_from_imports'] = False - - # If `True`, rope will transform a comma list of imports into - # multiple separate import statements when organizing - # imports. - prefs['split_imports'] = False - - # If `True`, rope will remove all top-level import statements and - # reinsert them at the top of the module when making changes. - prefs['pull_imports_to_top'] = True - - # If `True`, rope will sort imports alphabetically by module name instead - # of alphabetically by import statement, with from imports after normal - # imports. - prefs['sort_imports_alphabetically'] = False - - # Location of implementation of - # rope.base.oi.type_hinting.interfaces.ITypeHintingFactory In general - # case, you don't have to change this value, unless you're an rope expert. - # Change this value to inject you own implementations of interfaces - # listed in module rope.base.oi.type_hinting.providers.interfaces - # For example, you can add you own providers for Django Models, or disable - # the search type-hinting in a class hierarchy, etc. - prefs['type_hinting_factory'] = ( - 'rope.base.oi.type_hinting.factory.default_type_hinting_factory') - - -def project_opened(project): - """This function is called after opening the project""" - # Do whatever you like here! diff --git a/src/test/pythonFiles/refactoring/source folder/.vscode/.ropeproject/objectdb b/src/test/pythonFiles/refactoring/source folder/.vscode/.ropeproject/objectdb deleted file mode 100644 index 0a47446c0ad2..000000000000 Binary files a/src/test/pythonFiles/refactoring/source folder/.vscode/.ropeproject/objectdb and /dev/null differ diff --git a/src/test/pythonFiles/sorting/noconfig/after.py b/src/test/pythonFiles/sorting/noconfig/after.py deleted file mode 100644 index b768c396014c..000000000000 --- a/src/test/pythonFiles/sorting/noconfig/after.py +++ /dev/null @@ -1,16 +0,0 @@ -import io; sys; json -import traceback - -import rope -import rope.base.project -import rope.base.taskhandle -from rope.base import libutils -from rope.refactor.extract import ExtractMethod, ExtractVariable -from rope.refactor.rename import Rename - -WORKSPACE_ROOT = sys.argv[1] -ROPE_PROJECT_FOLDER = sys.argv[2] - - -def test(): - pass diff --git a/src/test/pythonFiles/sorting/noconfig/before.py b/src/test/pythonFiles/sorting/noconfig/before.py deleted file mode 100644 index fcd7318b5c02..000000000000 --- a/src/test/pythonFiles/sorting/noconfig/before.py +++ /dev/null @@ -1,18 +0,0 @@ -import io; sys; json -import traceback -import rope - -import rope.base.project -import rope.base.taskhandle - -WORKSPACE_ROOT = sys.argv[1] -ROPE_PROJECT_FOLDER = sys.argv[2] - - -def test(): - pass - -from rope.base import libutils -from rope.refactor.rename import Rename -from rope.refactor.extract import ExtractMethod, ExtractVariable - \ No newline at end of file diff --git a/src/test/pythonFiles/sorting/noconfig/original.py b/src/test/pythonFiles/sorting/noconfig/original.py deleted file mode 100644 index fcd7318b5c02..000000000000 --- a/src/test/pythonFiles/sorting/noconfig/original.py +++ /dev/null @@ -1,18 +0,0 @@ -import io; sys; json -import traceback -import rope - -import rope.base.project -import rope.base.taskhandle - -WORKSPACE_ROOT = sys.argv[1] -ROPE_PROJECT_FOLDER = sys.argv[2] - - -def test(): - pass - -from rope.base import libutils -from rope.refactor.rename import Rename -from rope.refactor.extract import ExtractMethod, ExtractVariable - \ No newline at end of file diff --git a/src/test/pythonFiles/sorting/withconfig/.isort.cfg b/src/test/pythonFiles/sorting/withconfig/.isort.cfg deleted file mode 100644 index 68da732e2b4b..000000000000 --- a/src/test/pythonFiles/sorting/withconfig/.isort.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[settings] -force_single_line=True \ No newline at end of file diff --git a/src/test/pythonFiles/sorting/withconfig/after.py b/src/test/pythonFiles/sorting/withconfig/after.py deleted file mode 100644 index e1fd315dbf92..000000000000 --- a/src/test/pythonFiles/sorting/withconfig/after.py +++ /dev/null @@ -1,3 +0,0 @@ -from third_party import (lib1, lib2, lib3, - lib4, lib5, lib6, - lib7, lib8, lib9) \ No newline at end of file diff --git a/src/test/pythonFiles/sorting/withconfig/before.1.py b/src/test/pythonFiles/sorting/withconfig/before.1.py deleted file mode 100644 index e1fd315dbf92..000000000000 --- a/src/test/pythonFiles/sorting/withconfig/before.1.py +++ /dev/null @@ -1,3 +0,0 @@ -from third_party import (lib1, lib2, lib3, - lib4, lib5, lib6, - lib7, lib8, lib9) \ No newline at end of file diff --git a/src/test/pythonFiles/sorting/withconfig/before.py b/src/test/pythonFiles/sorting/withconfig/before.py deleted file mode 100644 index e1fd315dbf92..000000000000 --- a/src/test/pythonFiles/sorting/withconfig/before.py +++ /dev/null @@ -1,3 +0,0 @@ -from third_party import (lib1, lib2, lib3, - lib4, lib5, lib6, - lib7, lib8, lib9) \ No newline at end of file diff --git a/src/test/pythonFiles/sorting/withconfig/original.1.py b/src/test/pythonFiles/sorting/withconfig/original.1.py deleted file mode 100644 index e1fd315dbf92..000000000000 --- a/src/test/pythonFiles/sorting/withconfig/original.1.py +++ /dev/null @@ -1,3 +0,0 @@ -from third_party import (lib1, lib2, lib3, - lib4, lib5, lib6, - lib7, lib8, lib9) \ No newline at end of file diff --git a/src/test/pythonFiles/sorting/withconfig/original.py b/src/test/pythonFiles/sorting/withconfig/original.py deleted file mode 100644 index e1fd315dbf92..000000000000 --- a/src/test/pythonFiles/sorting/withconfig/original.py +++ /dev/null @@ -1,3 +0,0 @@ -from third_party import (lib1, lib2, lib3, - lib4, lib5, lib6, - lib7, lib8, lib9) \ No newline at end of file diff --git a/src/test/pythonFiles/datascience/simple_nb.ipynb b/src/test/python_files/datascience/simple_nb.ipynb similarity index 100% rename from src/test/pythonFiles/datascience/simple_nb.ipynb rename to src/test/python_files/datascience/simple_nb.ipynb diff --git a/src/test/pythonFiles/datascience/simple_note_book.py b/src/test/python_files/datascience/simple_note_book.py similarity index 100% rename from src/test/pythonFiles/datascience/simple_note_book.py rename to src/test/python_files/datascience/simple_note_book.py diff --git a/src/test/pythonFiles/debugging/forever.py b/src/test/python_files/debugging/forever.py similarity index 100% rename from src/test/pythonFiles/debugging/forever.py rename to src/test/python_files/debugging/forever.py diff --git a/src/test/pythonFiles/debugging/logMessage.py b/src/test/python_files/debugging/logMessage.py similarity index 100% rename from src/test/pythonFiles/debugging/logMessage.py rename to src/test/python_files/debugging/logMessage.py diff --git a/src/test/pythonFiles/debugging/loopyTest.py b/src/test/python_files/debugging/loopyTest.py similarity index 100% rename from src/test/pythonFiles/debugging/loopyTest.py rename to src/test/python_files/debugging/loopyTest.py diff --git a/src/test/pythonFiles/debugging/multiThread.py b/src/test/python_files/debugging/multiThread.py similarity index 100% rename from src/test/pythonFiles/debugging/multiThread.py rename to src/test/python_files/debugging/multiThread.py diff --git a/src/test/pythonFiles/debugging/printSysArgv.py b/src/test/python_files/debugging/printSysArgv.py similarity index 100% rename from src/test/pythonFiles/debugging/printSysArgv.py rename to src/test/python_files/debugging/printSysArgv.py diff --git a/src/test/pythonFiles/debugging/sample2.py b/src/test/python_files/debugging/sample2.py similarity index 100% rename from src/test/pythonFiles/debugging/sample2.py rename to src/test/python_files/debugging/sample2.py diff --git a/src/test/pythonFiles/debugging/sample2WithoutSleep.py b/src/test/python_files/debugging/sample2WithoutSleep.py similarity index 100% rename from src/test/pythonFiles/debugging/sample2WithoutSleep.py rename to src/test/python_files/debugging/sample2WithoutSleep.py diff --git a/src/test/pythonFiles/debugging/sample3WithEx.py b/src/test/python_files/debugging/sample3WithEx.py similarity index 100% rename from src/test/pythonFiles/debugging/sample3WithEx.py rename to src/test/python_files/debugging/sample3WithEx.py diff --git a/src/test/pythonFiles/debugging/sampleWithAssertEx.py b/src/test/python_files/debugging/sampleWithAssertEx.py similarity index 100% rename from src/test/pythonFiles/debugging/sampleWithAssertEx.py rename to src/test/python_files/debugging/sampleWithAssertEx.py diff --git a/src/test/pythonFiles/debugging/sampleWithSleep.py b/src/test/python_files/debugging/sampleWithSleep.py similarity index 100% rename from src/test/pythonFiles/debugging/sampleWithSleep.py rename to src/test/python_files/debugging/sampleWithSleep.py diff --git a/src/test/pythonFiles/debugging/simplePrint.py b/src/test/python_files/debugging/simplePrint.py similarity index 100% rename from src/test/pythonFiles/debugging/simplePrint.py rename to src/test/python_files/debugging/simplePrint.py diff --git a/src/test/pythonFiles/debugging/stackFrame.py b/src/test/python_files/debugging/stackFrame.py similarity index 100% rename from src/test/pythonFiles/debugging/stackFrame.py rename to src/test/python_files/debugging/stackFrame.py diff --git a/src/test/pythonFiles/debugging/startAndWait.py b/src/test/python_files/debugging/startAndWait.py similarity index 100% rename from src/test/pythonFiles/debugging/startAndWait.py rename to src/test/python_files/debugging/startAndWait.py diff --git a/src/test/pythonFiles/debugging/stdErrOutput.py b/src/test/python_files/debugging/stdErrOutput.py similarity index 100% rename from src/test/pythonFiles/debugging/stdErrOutput.py rename to src/test/python_files/debugging/stdErrOutput.py diff --git a/src/test/pythonFiles/debugging/stdOutOutput.py b/src/test/python_files/debugging/stdOutOutput.py similarity index 100% rename from src/test/pythonFiles/debugging/stdOutOutput.py rename to src/test/python_files/debugging/stdOutOutput.py diff --git a/src/test/pythonFiles/debugging/wait_for_file.py b/src/test/python_files/debugging/wait_for_file.py similarity index 100% rename from src/test/pythonFiles/debugging/wait_for_file.py rename to src/test/python_files/debugging/wait_for_file.py diff --git a/src/test/pythonFiles/dummy.py b/src/test/python_files/dummy.py similarity index 100% rename from src/test/pythonFiles/dummy.py rename to src/test/python_files/dummy.py diff --git a/src/test/pythonFiles/environments/conda/Scripts/conda.exe b/src/test/python_files/environments/conda/Scripts/conda.exe similarity index 100% rename from src/test/pythonFiles/environments/conda/Scripts/conda.exe rename to src/test/python_files/environments/conda/Scripts/conda.exe diff --git a/src/test/pythonFiles/environments/conda/bin/python b/src/test/python_files/environments/conda/bin/python similarity index 100% rename from src/test/pythonFiles/environments/conda/bin/python rename to src/test/python_files/environments/conda/bin/python diff --git a/src/test/pythonFiles/environments/conda/envs/numpy/bin/python b/src/test/python_files/environments/conda/envs/numpy/bin/python similarity index 100% rename from src/test/pythonFiles/environments/conda/envs/numpy/bin/python rename to src/test/python_files/environments/conda/envs/numpy/bin/python diff --git a/src/test/pythonFiles/environments/conda/envs/numpy/python.exe b/src/test/python_files/environments/conda/envs/numpy/python.exe similarity index 100% rename from src/test/pythonFiles/environments/conda/envs/numpy/python.exe rename to src/test/python_files/environments/conda/envs/numpy/python.exe diff --git a/src/test/pythonFiles/environments/conda/envs/scipy/bin/python b/src/test/python_files/environments/conda/envs/scipy/bin/python similarity index 100% rename from src/test/pythonFiles/environments/conda/envs/scipy/bin/python rename to src/test/python_files/environments/conda/envs/scipy/bin/python diff --git a/src/test/pythonFiles/environments/conda/envs/scipy/python.exe b/src/test/python_files/environments/conda/envs/scipy/python.exe similarity index 100% rename from src/test/pythonFiles/environments/conda/envs/scipy/python.exe rename to src/test/python_files/environments/conda/envs/scipy/python.exe diff --git a/src/test/pythonFiles/environments/path1/one b/src/test/python_files/environments/path1/one similarity index 100% rename from src/test/pythonFiles/environments/path1/one rename to src/test/python_files/environments/path1/one diff --git a/src/test/pythonFiles/environments/path1/one.exe b/src/test/python_files/environments/path1/one.exe similarity index 100% rename from src/test/pythonFiles/environments/path1/one.exe rename to src/test/python_files/environments/path1/one.exe diff --git a/src/test/pythonFiles/environments/path1/python.exe b/src/test/python_files/environments/path1/python.exe similarity index 100% rename from src/test/pythonFiles/environments/path1/python.exe rename to src/test/python_files/environments/path1/python.exe diff --git a/src/test/pythonFiles/environments/path2/one b/src/test/python_files/environments/path2/one similarity index 100% rename from src/test/pythonFiles/environments/path2/one rename to src/test/python_files/environments/path2/one diff --git a/src/test/pythonFiles/environments/path2/one.exe b/src/test/python_files/environments/path2/one.exe similarity index 100% rename from src/test/pythonFiles/environments/path2/one.exe rename to src/test/python_files/environments/path2/one.exe diff --git a/src/test/pythonFiles/environments/path2/python.exe b/src/test/python_files/environments/path2/python.exe similarity index 100% rename from src/test/pythonFiles/environments/path2/python.exe rename to src/test/python_files/environments/path2/python.exe diff --git a/src/test/pythonFiles/intellisense/test.py b/src/test/python_files/intellisense/test.py similarity index 100% rename from src/test/pythonFiles/intellisense/test.py rename to src/test/python_files/intellisense/test.py diff --git a/src/test/pythonFiles/shebang/plain.py b/src/test/python_files/shebang/plain.py similarity index 100% rename from src/test/pythonFiles/shebang/plain.py rename to src/test/python_files/shebang/plain.py diff --git a/src/test/pythonFiles/shebang/shebang.py b/src/test/python_files/shebang/shebang.py similarity index 100% rename from src/test/pythonFiles/shebang/shebang.py rename to src/test/python_files/shebang/shebang.py diff --git a/src/test/pythonFiles/shebang/shebangEnv.py b/src/test/python_files/shebang/shebangEnv.py similarity index 100% rename from src/test/pythonFiles/shebang/shebangEnv.py rename to src/test/python_files/shebang/shebangEnv.py diff --git a/src/test/pythonFiles/shebang/shebangInvalid.py b/src/test/python_files/shebang/shebangInvalid.py similarity index 100% rename from src/test/pythonFiles/shebang/shebangInvalid.py rename to src/test/python_files/shebang/shebangInvalid.py diff --git a/src/test/pythonFiles/tensorBoard/noMatch.py b/src/test/python_files/tensorBoard/noMatch.py similarity index 100% rename from src/test/pythonFiles/tensorBoard/noMatch.py rename to src/test/python_files/tensorBoard/noMatch.py diff --git a/src/test/pythonFiles/tensorBoard/sourcefile.py b/src/test/python_files/tensorBoard/sourcefile.py similarity index 100% rename from src/test/pythonFiles/tensorBoard/sourcefile.py rename to src/test/python_files/tensorBoard/sourcefile.py diff --git a/src/test/pythonFiles/tensorBoard/tensorboard_import.ipynb b/src/test/python_files/tensorBoard/tensorboard_import.ipynb similarity index 100% rename from src/test/pythonFiles/tensorBoard/tensorboard_import.ipynb rename to src/test/python_files/tensorBoard/tensorboard_import.ipynb diff --git a/src/test/pythonFiles/tensorBoard/tensorboard_imports.py b/src/test/python_files/tensorBoard/tensorboard_imports.py similarity index 100% rename from src/test/pythonFiles/tensorBoard/tensorboard_imports.py rename to src/test/python_files/tensorBoard/tensorboard_imports.py diff --git a/src/test/pythonFiles/tensorBoard/tensorboard_launch.py b/src/test/python_files/tensorBoard/tensorboard_launch.py similarity index 100% rename from src/test/pythonFiles/tensorBoard/tensorboard_launch.py rename to src/test/python_files/tensorBoard/tensorboard_launch.py diff --git a/src/test/pythonFiles/tensorBoard/tensorboard_nbextension.ipynb b/src/test/python_files/tensorBoard/tensorboard_nbextension.ipynb similarity index 100% rename from src/test/pythonFiles/tensorBoard/tensorboard_nbextension.ipynb rename to src/test/python_files/tensorBoard/tensorboard_nbextension.ipynb diff --git a/src/test/pythonFiles/terminalExec/sample1_normalized.py b/src/test/python_files/terminalExec/sample1_normalized.py similarity index 100% rename from src/test/pythonFiles/terminalExec/sample1_normalized.py rename to src/test/python_files/terminalExec/sample1_normalized.py diff --git a/src/test/pythonFiles/terminalExec/sample1_normalized_selection.py b/src/test/python_files/terminalExec/sample1_normalized_selection.py similarity index 100% rename from src/test/pythonFiles/terminalExec/sample1_normalized_selection.py rename to src/test/python_files/terminalExec/sample1_normalized_selection.py diff --git a/src/test/pythonFiles/terminalExec/sample1_raw.py b/src/test/python_files/terminalExec/sample1_raw.py similarity index 100% rename from src/test/pythonFiles/terminalExec/sample1_raw.py rename to src/test/python_files/terminalExec/sample1_raw.py diff --git a/src/test/pythonFiles/terminalExec/sample2_normalized.py b/src/test/python_files/terminalExec/sample2_normalized.py similarity index 100% rename from src/test/pythonFiles/terminalExec/sample2_normalized.py rename to src/test/python_files/terminalExec/sample2_normalized.py diff --git a/src/test/pythonFiles/terminalExec/sample2_normalized_selection.py b/src/test/python_files/terminalExec/sample2_normalized_selection.py similarity index 100% rename from src/test/pythonFiles/terminalExec/sample2_normalized_selection.py rename to src/test/python_files/terminalExec/sample2_normalized_selection.py diff --git a/src/test/pythonFiles/terminalExec/sample2_raw.py b/src/test/python_files/terminalExec/sample2_raw.py similarity index 100% rename from src/test/pythonFiles/terminalExec/sample2_raw.py rename to src/test/python_files/terminalExec/sample2_raw.py diff --git a/src/test/pythonFiles/terminalExec/sample3_normalized.py b/src/test/python_files/terminalExec/sample3_normalized.py similarity index 100% rename from src/test/pythonFiles/terminalExec/sample3_normalized.py rename to src/test/python_files/terminalExec/sample3_normalized.py diff --git a/src/test/pythonFiles/terminalExec/sample3_normalized_selection.py b/src/test/python_files/terminalExec/sample3_normalized_selection.py similarity index 100% rename from src/test/pythonFiles/terminalExec/sample3_normalized_selection.py rename to src/test/python_files/terminalExec/sample3_normalized_selection.py diff --git a/src/test/pythonFiles/terminalExec/sample3_raw.py b/src/test/python_files/terminalExec/sample3_raw.py similarity index 100% rename from src/test/pythonFiles/terminalExec/sample3_raw.py rename to src/test/python_files/terminalExec/sample3_raw.py diff --git a/src/test/pythonFiles/terminalExec/sample4_normalized.py b/src/test/python_files/terminalExec/sample4_normalized.py similarity index 100% rename from src/test/pythonFiles/terminalExec/sample4_normalized.py rename to src/test/python_files/terminalExec/sample4_normalized.py diff --git a/src/test/pythonFiles/terminalExec/sample4_normalized_selection.py b/src/test/python_files/terminalExec/sample4_normalized_selection.py similarity index 100% rename from src/test/pythonFiles/terminalExec/sample4_normalized_selection.py rename to src/test/python_files/terminalExec/sample4_normalized_selection.py diff --git a/src/test/pythonFiles/terminalExec/sample4_raw.py b/src/test/python_files/terminalExec/sample4_raw.py similarity index 100% rename from src/test/pythonFiles/terminalExec/sample4_raw.py rename to src/test/python_files/terminalExec/sample4_raw.py diff --git a/src/test/pythonFiles/terminalExec/sample5_normalized.py b/src/test/python_files/terminalExec/sample5_normalized.py similarity index 100% rename from src/test/pythonFiles/terminalExec/sample5_normalized.py rename to src/test/python_files/terminalExec/sample5_normalized.py diff --git a/src/test/pythonFiles/terminalExec/sample5_normalized_selection.py b/src/test/python_files/terminalExec/sample5_normalized_selection.py similarity index 100% rename from src/test/pythonFiles/terminalExec/sample5_normalized_selection.py rename to src/test/python_files/terminalExec/sample5_normalized_selection.py diff --git a/src/test/pythonFiles/terminalExec/sample5_raw.py b/src/test/python_files/terminalExec/sample5_raw.py similarity index 100% rename from src/test/pythonFiles/terminalExec/sample5_raw.py rename to src/test/python_files/terminalExec/sample5_raw.py diff --git a/src/test/pythonFiles/terminalExec/sample6_normalized.py b/src/test/python_files/terminalExec/sample6_normalized.py similarity index 100% rename from src/test/pythonFiles/terminalExec/sample6_normalized.py rename to src/test/python_files/terminalExec/sample6_normalized.py diff --git a/src/test/pythonFiles/terminalExec/sample6_normalized_selection.py b/src/test/python_files/terminalExec/sample6_normalized_selection.py similarity index 100% rename from src/test/pythonFiles/terminalExec/sample6_normalized_selection.py rename to src/test/python_files/terminalExec/sample6_normalized_selection.py diff --git a/src/test/pythonFiles/terminalExec/sample6_raw.py b/src/test/python_files/terminalExec/sample6_raw.py similarity index 100% rename from src/test/pythonFiles/terminalExec/sample6_raw.py rename to src/test/python_files/terminalExec/sample6_raw.py diff --git a/src/test/pythonFiles/terminalExec/sample7_normalized.py b/src/test/python_files/terminalExec/sample7_normalized.py similarity index 100% rename from src/test/pythonFiles/terminalExec/sample7_normalized.py rename to src/test/python_files/terminalExec/sample7_normalized.py diff --git a/src/test/pythonFiles/terminalExec/sample7_normalized_selection.py b/src/test/python_files/terminalExec/sample7_normalized_selection.py similarity index 100% rename from src/test/pythonFiles/terminalExec/sample7_normalized_selection.py rename to src/test/python_files/terminalExec/sample7_normalized_selection.py diff --git a/src/test/pythonFiles/terminalExec/sample7_raw.py b/src/test/python_files/terminalExec/sample7_raw.py similarity index 100% rename from src/test/pythonFiles/terminalExec/sample7_raw.py rename to src/test/python_files/terminalExec/sample7_raw.py diff --git a/src/test/pythonFiles/terminalExec/sample8_normalized.py b/src/test/python_files/terminalExec/sample8_normalized.py similarity index 100% rename from src/test/pythonFiles/terminalExec/sample8_normalized.py rename to src/test/python_files/terminalExec/sample8_normalized.py diff --git a/src/test/pythonFiles/terminalExec/sample8_normalized_selection.py b/src/test/python_files/terminalExec/sample8_normalized_selection.py similarity index 100% rename from src/test/pythonFiles/terminalExec/sample8_normalized_selection.py rename to src/test/python_files/terminalExec/sample8_normalized_selection.py diff --git a/src/test/pythonFiles/terminalExec/sample8_raw.py b/src/test/python_files/terminalExec/sample8_raw.py similarity index 100% rename from src/test/pythonFiles/terminalExec/sample8_raw.py rename to src/test/python_files/terminalExec/sample8_raw.py diff --git a/src/test/pythonFiles/terminalExec/sample_invalid_smart_selection.py b/src/test/python_files/terminalExec/sample_invalid_smart_selection.py similarity index 100% rename from src/test/pythonFiles/terminalExec/sample_invalid_smart_selection.py rename to src/test/python_files/terminalExec/sample_invalid_smart_selection.py diff --git a/src/test/pythonFiles/terminalExec/sample_normalized.py b/src/test/python_files/terminalExec/sample_normalized.py similarity index 100% rename from src/test/pythonFiles/terminalExec/sample_normalized.py rename to src/test/python_files/terminalExec/sample_normalized.py diff --git a/src/test/pythonFiles/terminalExec/sample_normalized_selection.py b/src/test/python_files/terminalExec/sample_normalized_selection.py similarity index 100% rename from src/test/pythonFiles/terminalExec/sample_normalized_selection.py rename to src/test/python_files/terminalExec/sample_normalized_selection.py diff --git a/src/test/pythonFiles/terminalExec/sample_raw.py b/src/test/python_files/terminalExec/sample_raw.py similarity index 100% rename from src/test/pythonFiles/terminalExec/sample_raw.py rename to src/test/python_files/terminalExec/sample_raw.py diff --git a/src/test/pythonFiles/terminalExec/sample_smart_selection.py b/src/test/python_files/terminalExec/sample_smart_selection.py similarity index 100% rename from src/test/pythonFiles/terminalExec/sample_smart_selection.py rename to src/test/python_files/terminalExec/sample_smart_selection.py diff --git a/src/test/smoke/datascience.smoke.test.ts b/src/test/smoke/datascience.smoke.test.ts index ebd101b5849f..30298183c511 100644 --- a/src/test/smoke/datascience.smoke.test.ts +++ b/src/test/smoke/datascience.smoke.test.ts @@ -35,7 +35,7 @@ suite('Smoke Test: Datascience', () => { EXTENSION_ROOT_DIR_FOR_TESTS, 'src', 'test', - 'pythonFiles', + 'python_files', 'datascience', 'simple_note_book.py', ); @@ -60,7 +60,7 @@ suite('Smoke Test: Datascience', () => { EXTENSION_ROOT_DIR_FOR_TESTS, 'src', 'test', - 'pythonFiles', + 'python_files', 'datascience', 'simple_nb.ipynb', ); diff --git a/src/test/smoke/jedilsp.smoke.test.ts b/src/test/smoke/jedilsp.smoke.test.ts index acde436442e1..e25d2bcdd1cc 100644 --- a/src/test/smoke/jedilsp.smoke.test.ts +++ b/src/test/smoke/jedilsp.smoke.test.ts @@ -24,7 +24,7 @@ suite('Smoke Test: Jedi LSP', () => { teardown(closeActiveWindows); test('Verify diagnostics on a python file', async () => { - const file = path.join(EXTENSION_ROOT_DIR_FOR_TESTS, 'src', 'test', 'pythonFiles', 'intellisense', 'test.py'); + const file = path.join(EXTENSION_ROOT_DIR_FOR_TESTS, 'src', 'test', 'python_files', 'intellisense', 'test.py'); const outputFile = path.join(path.dirname(file), 'ds.log'); if (await fs.pathExists(outputFile)) { await fs.unlink(outputFile); diff --git a/src/test/tensorBoard/tensorBoardSession.test.ts b/src/test/tensorBoard/tensorBoardSession.test.ts index 2faaf8e39611..626740f4f530 100644 --- a/src/test/tensorBoard/tensorBoardSession.test.ts +++ b/src/test/tensorBoard/tensorBoardSession.test.ts @@ -461,7 +461,7 @@ suite('TensorBoard session creation', async () => { EXTENSION_ROOT_DIR_FOR_TESTS, 'src', 'test', - 'pythonFiles', + 'python_files', 'tensorBoard', 'sourcefile.py', ); diff --git a/src/test/terminals/codeExecution/helper.test.ts b/src/test/terminals/codeExecution/helper.test.ts index ac47037a2344..2922fe9a7ef4 100644 --- a/src/test/terminals/codeExecution/helper.test.ts +++ b/src/test/terminals/codeExecution/helper.test.ts @@ -32,7 +32,7 @@ import { CodeExecutionHelper } from '../../../client/terminals/codeExecution/hel import { ICodeExecutionHelper } from '../../../client/terminals/types'; import { PYTHON_PATH } from '../../common'; -const TEST_FILES_PATH = path.join(EXTENSION_ROOT_DIR, 'src', 'test', 'pythonFiles', 'terminalExec'); +const TEST_FILES_PATH = path.join(EXTENSION_ROOT_DIR, 'src', 'test', 'python_files', 'terminalExec'); suite('Terminal - Code Execution Helper', () => { let documentManager: TypeMoq.IMock; diff --git a/src/test/terminals/codeExecution/smartSend.test.ts b/src/test/terminals/codeExecution/smartSend.test.ts index 4963629d0fda..99678ec1cb8d 100644 --- a/src/test/terminals/codeExecution/smartSend.test.ts +++ b/src/test/terminals/codeExecution/smartSend.test.ts @@ -24,7 +24,7 @@ import { Architecture } from '../../../client/common/utils/platform'; import { ProcessService } from '../../../client/common/process/proc'; import { l10n } from '../../mocks/vsc'; -const TEST_FILES_PATH = path.join(EXTENSION_ROOT_DIR, 'src', 'test', 'pythonFiles', 'terminalExec'); +const TEST_FILES_PATH = path.join(EXTENSION_ROOT_DIR, 'src', 'test', 'python_files', 'terminalExec'); suite('REPL - Smart Send', () => { let documentManager: TypeMoq.IMock; diff --git a/src/test/testing/common/debugLauncher.unit.test.ts b/src/test/testing/common/debugLauncher.unit.test.ts index 1c69bac20593..ef3e678c13f7 100644 --- a/src/test/testing/common/debugLauncher.unit.test.ts +++ b/src/test/testing/common/debugLauncher.unit.test.ts @@ -151,10 +151,10 @@ suite('Unit Tests - Debug Launcher', () => { if (!pythonTestAdapterRewriteExperiment) { switch (testProvider) { case 'unittest': { - return path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'visualstudio_py_testlauncher.py'); + return path.join(EXTENSION_ROOT_DIR, 'python_files', 'visualstudio_py_testlauncher.py'); } case 'pytest': { - return path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'testlauncher.py'); + return path.join(EXTENSION_ROOT_DIR, 'python_files', 'testlauncher.py'); } default: { throw new Error(`Unknown test provider '${testProvider}'`); @@ -208,14 +208,14 @@ suite('Unit Tests - Debug Launcher', () => { if (!expected) { expected = getDefaultDebugConfig(); } - expected.rules = [{ path: path.join(EXTENSION_ROOT_DIR, 'pythonFiles'), include: false }]; + expected.rules = [{ path: path.join(EXTENSION_ROOT_DIR, 'python_files'), include: false }]; expected.program = testLaunchScript; expected.args = options.args; if (!expected.cwd) { expected.cwd = workspaceFolders[0].uri.fsPath; } - const pluginPath = path.join(EXTENSION_ROOT_DIR, 'pythonFiles'); + const pluginPath = path.join(EXTENSION_ROOT_DIR, 'python_files'); const pythonPath = `${pluginPath}${path.delimiter}${expected.cwd}`; expected.env.PYTHONPATH = pythonPath; @@ -345,7 +345,7 @@ suite('Unit Tests - Debug Launcher', () => { }; const expected = getDefaultDebugConfig(); expected.cwd = 'path/to/settings/cwd'; - const pluginPath = path.join(EXTENSION_ROOT_DIR, 'pythonFiles'); + const pluginPath = path.join(EXTENSION_ROOT_DIR, 'python_files'); const pythonPath = `${pluginPath}${path.delimiter}${expected.cwd}`; expected.env.PYTHONPATH = pythonPath; diff --git a/src/test/testing/testController/pytest/pytestDiscoveryAdapter.unit.test.ts b/src/test/testing/testController/pytest/pytestDiscoveryAdapter.unit.test.ts index 45f6d4ffa8eb..3b1e8fec6d6d 100644 --- a/src/test/testing/testController/pytest/pytestDiscoveryAdapter.unit.test.ts +++ b/src/test/testing/testController/pytest/pytestDiscoveryAdapter.unit.test.ts @@ -46,7 +46,7 @@ suite('pytest test discovery adapter', () => { uuid = 'uuid123'; expectedPath = path.join('/', 'my', 'test', 'path'); uri = Uri.file(expectedPath); - const relativePathToPytest = 'pythonFiles'; + const relativePathToPytest = 'python_files'; const fullPluginPath = path.join(EXTENSION_ROOT_DIR, relativePathToPytest); expectedExtraVariables = { PYTHONPATH: fullPluginPath, diff --git a/src/test/testing/testController/pytest/pytestExecutionAdapter.unit.test.ts b/src/test/testing/testController/pytest/pytestExecutionAdapter.unit.test.ts index d2ab19368b2d..26a19ed0fd09 100644 --- a/src/test/testing/testController/pytest/pytestExecutionAdapter.unit.test.ts +++ b/src/test/testing/testController/pytest/pytestExecutionAdapter.unit.test.ts @@ -169,7 +169,7 @@ suite('pytest test execution adapter', () => { await deferred4.promise; mockProc.trigger('close'); - const pathToPythonFiles = path.join(EXTENSION_ROOT_DIR, 'pythonFiles'); + const pathToPythonFiles = path.join(EXTENSION_ROOT_DIR, 'python_files'); const pathToPythonScript = path.join(pathToPythonFiles, 'vscode_pytest', 'run_pytest_script.py'); const rootDirArg = `--rootdir=${myTestPath}`; const expectedArgs = [pathToPythonScript, rootDirArg]; @@ -237,7 +237,7 @@ suite('pytest test execution adapter', () => { await deferred4.promise; mockProc.trigger('close'); - const pathToPythonFiles = path.join(EXTENSION_ROOT_DIR, 'pythonFiles'); + const pathToPythonFiles = path.join(EXTENSION_ROOT_DIR, 'python_files'); const pathToPythonScript = path.join(pathToPythonFiles, 'vscode_pytest', 'run_pytest_script.py'); const expectedArgs = [pathToPythonScript, `--rootdir=${newCwd}`]; const expectedExtraVariables = { diff --git a/src/test/testing/testController/unittest/testDiscoveryAdapter.unit.test.ts b/src/test/testing/testController/unittest/testDiscoveryAdapter.unit.test.ts index 0eee88120f6a..c5fb0d421da6 100644 --- a/src/test/testing/testController/unittest/testDiscoveryAdapter.unit.test.ts +++ b/src/test/testing/testController/unittest/testDiscoveryAdapter.unit.test.ts @@ -42,7 +42,7 @@ suite('Unittest test discovery adapter', () => { } as unknown) as ITestServer; const uri = Uri.file('/foo/bar'); - const script = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'unittestadapter', 'discovery.py'); + const script = path.join(EXTENSION_ROOT_DIR, 'python_files', 'unittestadapter', 'discovery.py'); const adapter = new UnittestTestDiscoveryAdapter(stubTestServer, stubConfigSettings, outputChannel.object); adapter.discoverTests(uri); @@ -78,7 +78,7 @@ suite('Unittest test discovery adapter', () => { const uri = Uri.file('/foo/bar'); const newCwd = '/foo'; - const script = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'unittestadapter', 'discovery.py'); + const script = path.join(EXTENSION_ROOT_DIR, 'python_files', 'unittestadapter', 'discovery.py'); const adapter = new UnittestTestDiscoveryAdapter(stubTestServer, stubConfigSettings, outputChannel.object); adapter.discoverTests(uri); diff --git a/src/test/testing/testController/unittest/testExecutionAdapter.unit.test.ts b/src/test/testing/testController/unittest/testExecutionAdapter.unit.test.ts index e2903d353bbf..bb82f49b4777 100644 --- a/src/test/testing/testController/unittest/testExecutionAdapter.unit.test.ts +++ b/src/test/testing/testController/unittest/testExecutionAdapter.unit.test.ts @@ -50,7 +50,7 @@ suite('Unittest test execution adapter', () => { } as unknown) as ITestServer; const uri = Uri.file('/foo/bar'); - const script = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'unittestadapter', 'execution.py'); + const script = path.join(EXTENSION_ROOT_DIR, 'python_files', 'unittestadapter', 'execution.py'); const adapter = new UnittestTestExecutionAdapter(stubTestServer, stubConfigSettings, outputChannel.object); const testIds = ['test1id', 'test2id']; @@ -94,7 +94,7 @@ suite('Unittest test execution adapter', () => { const newCwd = '/foo'; const uri = Uri.file('/foo/bar'); - const script = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'unittestadapter', 'execution.py'); + const script = path.join(EXTENSION_ROOT_DIR, 'python_files', 'unittestadapter', 'execution.py'); const adapter = new UnittestTestExecutionAdapter(stubTestServer, stubConfigSettings, outputChannel.object); const testIds = ['test1id', 'test2id'];