Skip to content

Commit

Permalink
pytest: package conftest (#576)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
oliver-sanders authored Aug 24, 2021
1 parent b908f55 commit 49d5772
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ jobs:
pip check
- name: Run the tests
run: |
pytest -vv --integration_tests=true
pytest -vv --integration_tests=true jupyter_server
6 changes: 3 additions & 3 deletions .github/workflows/python-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,17 @@ jobs:
- name: Run the tests
if: ${{ matrix.python-version != 'pypy3' }}
run: |
pytest -vv --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered
pytest -vv jupyter_server --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered
- name: Run the tests on pypy
if: ${{ matrix.python-version == 'pypy3' }}
run: |
pytest -vv
pytest -vv jupyter_server
- name: Install the Python dependencies for the examples
run: |
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
6 changes: 3 additions & 3 deletions .github/workflows/python-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@ jobs:
- name: Run the tests
if: ${{ !startsWith( matrix.python-version, 'pypy' ) }}
run: |
pytest -vv --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered
pytest -vv jupyter_server --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered
- name: Run the tests on pypy
if: ${{ startsWith( matrix.python-version, 'pypy' ) }}
run: |
pytest -vv
pytest -vv jupyter_server
- name: Install the Python dependencies for the examples
run: |
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: ${{ !startsWith( matrix.python-version, 'pypy' ) }}
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ jobs:
# the file descriptions opened by the asyncio IOLoop.
# This leads to a nasty, flaky race condition that we haven't
# been able to solve.
pytest -vv -s
pytest -vv -s jupyter_server
- name: Install the Python dependencies for the examples
run: |
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
6 changes: 3 additions & 3 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 jupyter_server
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 @@ -11,7 +11,7 @@ ignore = ["tbump.toml", ".*", "*.yml", "package-lock.json", "bootstrap*", "conft
[tool.pytest.ini_options]
addopts = "--doctest-modules"
testpaths = [
"jupyter_server"
"jupyter_server/"
]

[tool.jupyter-releaser]
Expand Down

0 comments on commit 49d5772

Please sign in to comment.