Skip to content

Expose a jupyter_server pytest plugin #162

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Jan 10, 2020

Conversation

Zsailer
Copy link
Member

@Zsailer Zsailer commented Dec 31, 2019

This PR moves the conftest into the jupyter_server module and exposes an entrypoint to that module to enable extensions to use these helpful fixtures for testing.

To use these fixtures, you simply have to add pytest_jupyter_server to the pytest_plugins list in any test suite.

@echarles
Copy link
Member

echarles commented Jan 4, 2020

@Zsailer Strange: Failing for windows py 3.8 on appveyor while succeeding on github actions. I can't remember we had such cases during our sprint to make tests green a few weeks ago...?

self = <ProactorEventLoop running=False closed=False debug=False>, fd = 736
callback = <bound method BaseAsyncIOLoop._handle_events of <zmq.eventloop.ioloop.ZMQIOLoop object at 0x00000099447949D0>>
args = (736, 4)
    def add_writer(self, fd, callback, *args):
>       raise NotImplementedError
E       NotImplementedError
c:\miniconda37-x64\envs\test-env-38\lib\asyncio\events.py:507: NotImplementedError

The print message you have added shows exactly the same information: win32 sys.version_info(major=3, minor=8, micro=0, releaselevel='final', serial=0)

Maybe @kevin-bates can help here?

@Zsailer
Copy link
Member Author

Zsailer commented Jan 9, 2020

Hm, this was really weird. I changed a few things:

  1. I removed ipykernel from the conda install list. I don't know why, but it appears the conda version of ipykernel was being used over the source version we cloned+installed later in the CI script.
  2. I removed to "windows +Python 3.8" conditional from the plugin. This condition is already checked by the _init_asyncio_patch in serverapp, so it was redundant to check for conditional again. It avoids adding extra confusion to whether the patch is applied before or after the fixture is initialized...

Anyways, getting all greens now. Whoever wants to review, go ahead and squash and merge if you find no issues.

@echarles, you should be able to start using this for your jupyterlab_server branch. For an example on how to use this plugin, checkout the conftest file from nbclassic in Zsailer/nbclassic#4

@echarles
Copy link
Member

LGTM. Merging now.

Thx @Zsailer, this was not an easy one. I will start using the plugin for the jupyterlab_server tests.

@echarles echarles merged commit 45742d9 into jupyter-server:master Jan 10, 2020
@Zsailer Zsailer deleted the pytest-plugin branch January 10, 2020 17:34
Zsailer added a commit to Zsailer/jupyter_server that referenced this pull request Nov 18, 2022
hMED22 pushed a commit to hMED22/jupyter_server that referenced this pull request Jan 23, 2023
* make a jupyter server pytest plugin

* rollback extension conftest

* add a create_notebook fixture

* move ioloop into serverapp

* use pip to install dependencies

* Update jupyter_server/pytest_plugin.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants