|
3 | 3 | 1. Clone the repo: `git clone git@github.com:python-lsp/python-lsp-server.git` |
4 | 4 | 2. Create the virtual environment: `python3 -m venv .venv` |
5 | 5 | 3. Activate: `source .venv/bin/activate` |
6 | | - |
7 | | -Create a helper script to run the server without the need to `pip3 install` it |
8 | | -on every change and name it `run` or similar: |
9 | | - |
10 | | -```py |
11 | | -#!/home/user/projects/python-lsp-server/.venv/bin/python |
12 | | -import sys |
13 | | - |
14 | | -from pylsp.__main__ import main |
15 | | - |
16 | | -sys.exit(main()) |
17 | | -``` |
| 6 | +4. Install an editable installation: `pip3 install -e .` |
| 7 | + - This will ensure you'll see your edits immediately without reinstalling the project |
18 | 8 |
|
19 | 9 | ## Configure your editor |
20 | 10 |
|
@@ -63,5 +53,15 @@ Now the project is setup in a way you can quickly iterate change you want to add |
63 | 53 |
|
64 | 54 | # Running tests |
65 | 55 |
|
66 | | -1. Install dependencies: `pip3 install .[test]` |
67 | | -2. Run `pytest`: `pytest -v` |
| 56 | +1. Install runtime dependencies: `pip3 install .[all]` |
| 57 | +2. Install test dependencies: `pip3 install .[test]` |
| 58 | +3. Run `pytest`: `pytest -v` |
| 59 | + |
| 60 | +## Useful pytest options |
| 61 | + |
| 62 | +- To run a specific test file, use `pytest test/test_utils.py` |
| 63 | +- To run a specific test function within a test file, |
| 64 | + use `pytest test/test_utils.py::test_debounce` |
| 65 | +- To run tests matching a certain expression, use `pytest -k format` |
| 66 | +- To increase verbosity of pytest, use `pytest -v` or `pytest -vv` |
| 67 | +- To enter a debugger on failed tests, use `pytest --pdb` |
0 commit comments