Skip to content

Commit 49d5772

Browse files
pytest: package conftest (#576)
closes #563 * Package the conftest file. * This changes the test command to `pytest jupyter_server`. * Import the `jupyter_server.conftest` in the examples to inherit the plugin.
1 parent b908f55 commit 49d5772

File tree

8 files changed

+14
-13
lines changed

8 files changed

+14
-13
lines changed

.github/workflows/integration-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ jobs:
4444
pip check
4545
- name: Run the tests
4646
run: |
47-
pytest -vv --integration_tests=true
47+
pytest -vv --integration_tests=true jupyter_server

.github/workflows/python-linux.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,17 @@ jobs:
6969
- name: Run the tests
7070
if: ${{ matrix.python-version != 'pypy3' }}
7171
run: |
72-
pytest -vv --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered
72+
pytest -vv jupyter_server --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered
7373
- name: Run the tests on pypy
7474
if: ${{ matrix.python-version == 'pypy3' }}
7575
run: |
76-
pytest -vv
76+
pytest -vv jupyter_server
7777
- name: Install the Python dependencies for the examples
7878
run: |
7979
cd examples/simple && pip install -e .
8080
- name: Run the tests for the examples
8181
run: |
82-
pytest examples/simple/tests/test_handlers.py --confcutdir=$PWD
82+
pytest examples/simple
8383
- name: Coverage
8484
if: ${{ matrix.python-version != 'pypy3' }}
8585
run: |

.github/workflows/python-macos.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,17 @@ jobs:
4646
- name: Run the tests
4747
if: ${{ !startsWith( matrix.python-version, 'pypy' ) }}
4848
run: |
49-
pytest -vv --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered
49+
pytest -vv jupyter_server --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered
5050
- name: Run the tests on pypy
5151
if: ${{ startsWith( matrix.python-version, 'pypy' ) }}
5252
run: |
53-
pytest -vv
53+
pytest -vv jupyter_server
5454
- name: Install the Python dependencies for the examples
5555
run: |
5656
cd examples/simple && pip install -e .
5757
- name: Run the tests for the examples
5858
run: |
59-
pytest examples/simple/tests/test_handlers.py --confcutdir=$PWD
59+
pytest examples/simple
6060
- name: Coverage
6161
if: ${{ !startsWith( matrix.python-version, 'pypy' ) }}
6262
run: |

.github/workflows/python-windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ jobs:
4949
# the file descriptions opened by the asyncio IOLoop.
5050
# This leads to a nasty, flaky race condition that we haven't
5151
# been able to solve.
52-
pytest -vv -s
52+
pytest -vv -s jupyter_server
5353
- name: Install the Python dependencies for the examples
5454
run: |
5555
cd examples/simple && pip install -e .
5656
- name: Run the tests for the examples
5757
run: |
58-
pytest examples/simple/tests/test_handlers.py --confcutdir=$PWD
58+
pytest examples/simple

CONTRIBUTING.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ Running Tests
8585
Install dependencies::
8686

8787
pip install -e .[test]
88-
pip install -e examples/simple
88+
pip install -e examples/simple # to test the examples
8989

9090
To run the Python tests, use::
9191

92-
pytest
93-
pytest examples/simple --confcutdir=$PWD
92+
pytest jupyter_server
93+
pytest examples/simple # to test the examples
9494

9595
Building the Docs
9696
=================

examples/simple/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from jupyter_server.conftest import *
File renamed without changes.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ignore = ["tbump.toml", ".*", "*.yml", "package-lock.json", "bootstrap*", "conft
1111
[tool.pytest.ini_options]
1212
addopts = "--doctest-modules"
1313
testpaths = [
14-
"jupyter_server"
14+
"jupyter_server/"
1515
]
1616

1717
[tool.jupyter-releaser]

0 commit comments

Comments
 (0)