Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Latest commit

 

History

History
62 lines (54 loc) · 2.75 KB

README_VSCODE.md

File metadata and controls

62 lines (54 loc) · 2.75 KB

Wordplay: VS Code Configuration

Additional VS Code instructions that accompany the Wordplay mini project.

Contents

References

Quick Set Up

  1. Open Extensions in the lefthand nav, search for and install the Python extension.
    VS Code extensions
  2. Review the guide on VS Code and python virtual environments.
  3. Select your Python interpreter via the Command Palette:
    Go to menu View > Command Palette
    Type and select Python: Select Interpreter
    Select your virtual env from the list (look for "venv" or "pipenv")
  4. Configure this project for pytest via the Command Palette:
    Go to menu View > Command Palette
    Type and select Python: Configure Tests
    Select pytest from the options.
    Select . for the directory.
  5. Configure the VS code terminal to use the virtual environment.
    Open the VS configuration file at the root of the project .vscode/settings.json
    Add the following line to the JSON:
    "python.terminal.activateEnvironment": true,
    You should have something like:
{
  "python.pythonPath": "/some/path/in/your/workspace",
  "python.terminal.activateEnvironment": true,
  "python.unitTest.pyTestArgs": [
      "."
  ],
  "python.unitTest.unittestEnabled": false,
  "python.unitTest.nosetestsEnabled": false,
  "python.unitTest.pyTestEnabled": true
}
  1. Close and relaunch VS Code.
  2. Run pytest from the built in command prompt.
    If VS Code does not automatically activate your virtual environment, request it specifically:
    Go to menu View > Command Palette
    Type and select Terminal: Create New Integrated Terminal (In Active Workspace)
    You can confirm your virtual environment is active when (wordplay) is displayed in the prompt.
    From the command prompt type and execute:
    pytest -v
  3. Run pytest from the GUI.
    Select the chemistry flask icon on the left to open the test palette.
    Click the collapse/expand triangle to the left of "test_wordplay.py" to see all tests.
    Click the green play button to execute the tests.
    VS Code test palette
  4. Git branches can be managed and changed using the control in the bottom left corner.