Skip to content

Commit

Permalink
pytest: package conftest
Browse files Browse the repository at this point in the history
closes jupyter-server#563

* Add `jupyter_server` to the default pytest args to allow running
  `pytest` with no arguments.
* Import the `jupyter_server.conftest` in the examples to inherit the
  plugin.
  • Loading branch information
oliver-sanders committed Aug 23, 2021
1 parent 90f619c commit e279b17
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
cd examples/simple && pip install -e .
- name: Run the tests for the examples
run: |
pytest examples/simple/tests/test_handlers.py --confcutdir=$PWD
pytest examples/simple
- name: Coverage
if: ${{ matrix.python-version != 'pypy3' }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
cd examples/simple && pip install -e .
- name: Run the tests for the examples
run: |
pytest examples/simple/tests/test_handlers.py --confcutdir=$PWD
pytest examples/simple
- name: Coverage
if: ${{ matrix.python-version != 'pypy3' }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ jobs:
cd examples/simple && pip install -e .
- name: Run the tests for the examples
run: |
pytest examples/simple/tests/test_handlers.py --confcutdir=$PWD
pytest examples/simple
4 changes: 2 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ Running Tests
Install dependencies::

pip install -e .[test]
pip install -e examples/simple
pip install -e examples/simple # to test the examples

To run the Python tests, use::

pytest
pytest examples/simple --confcutdir=$PWD
pytest examples/simple # to test the examples

Building the Docs
=================
Expand Down
1 change: 1 addition & 0 deletions examples/simple/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from jupyter_server.conftest import *
File renamed without changes.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ factory = "jupyter_packaging.npm_builder"
ignore = ["tbump.toml", ".*", "*.yml", "package-lock.json", "bootstrap*", "conftest.py"]

[tool.pytest.ini_options]
addopts = "--doctest-modules"
addopts = "--doctest-modules jupyter_server"
testpaths = [
"jupyter_server"
]
Expand Down

0 comments on commit e279b17

Please sign in to comment.