Skip to content
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

Remove pytest11 entrypoint and plugin, require tornado 6.1, remove asyncio patch, CI work #339

Merged
merged 27 commits into from
Nov 17, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/simple/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest_plugins = ['jupyter_server.pytest_plugin']
3 changes: 0 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@
entry_points = {
'console_scripts': [
'jupyter-server = jupyter_server.serverapp:main',
],
'pytest11': [
'pytest_jupyter_server = jupyter_server.pytest_plugin'
]
},
)
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pytest_plugins = ['pytest_jupyter_server']
pytest_plugins = ['jupyter_server.pytest_plugin']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I'm confused on when this is necessary. Given these tests will depend on pytest-jupyter's pytest_jupytercore and pytest_jupyterserver plugins, do consumers of those fixtures (including jupyter_server) require a pytest_plugins statement or is the extra-requires [test] dependency on pytest-jupyter sufficient?

In working with #335, it doesn't seem like this entry (referencing the now external plugins) makes any difference.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the pytest11 entry point in this repo is removed, there would be no particular way for pytest to know that it should use it, it wouldn't be imported, and the issue wouldn't occur for folk that have packages installed that try to actually .load their entrypoints.

Of the seven ways a plugin can be found, if it a test dependency doesn't use number 4, i'm a big fan of being explicit in conftest.py (number 7) or command line (number 1), but checked in as checked in inside a file that ends up in the distribution, e.g. pyproject.toml, or setup.cfg rather than rely on env vars, switches, etc.

do consumers of those fixtures (including jupyter_server) require a pytest_plugins statement

Once it's an explicit, real dependency, on a dedicated, test-time package, then everything is cool, and no pytest_plugin variable will be required, as number 4 will take care of it.

So generally: you'd never want anything referenced by Other People's Entry Points (what you might not control) to be behind an extra... depending on how they are used (e.g. have to be actually imported).

The whole prefix thing from #335? Yeah, well, that's just what a test regume is buying into with magic named functions. I'm not a huge fan, as the pattern (which, luckily, seems to be rather unique) doesn't play nice-nice with other tools (e.g. mypy, etc). But it's the only game in town, aside from the few little ecosystems where they felt they had to home-roll their own thing... noflo, robotframework, etc. have extremely unpythonic things they do, in the name of specific purposes.