☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Running the tests locally

Community Support
jeremy9959
jeremy9959

Why do all of the test_examples.py fail when I run the tests locally?
I am doing

$ pytest

in the root of the bokeh repo. I haven’t touched any of the example files.

Just noticed others have asked this question, but still stumped. FYI the other tests work fine.

⌁   Link to post
Bryan
Bryan

@jeremy9959 There are lots of different kinds of tests under the tests directory:

  • Python unit tests
  • JavaScript unit tests
  • Selenium integration tests
  • Codebase checks
  • Examples tests

The “examples tests” are, first and foremost, present to be run on CI. That suite runs hundreds of image diff tests on every Bokeh example in the repo. It might take 30 or more minutes to complete. It also computes baseline layout geometries that currently are calibrated to the headless browser on the CI system, and which due to slight platform differences outside our control, may report failures on other systems. Besides all that, the necessary requirements to run this test suite are fairly onerous to install. It’s not expected that anyone is running these locally with any regularity (that is what the CI pipeline is for).

TLDR, you need to be more specific. If you just want to run the basic Python unit tests, you can do that:

py.test tests/unit

More detailed information about running tests is in the Developer’s Guide.

⌁   Link to post
jeremy9959
jeremy9959

Thanks – I was trying to avoid the process of pushing my PR and getting silly formatting mistakes. Knowing that the examples test are intended for CI is helpful, then I don’t have to worry about them.

⌁   Link to post
Bryan
Bryan

@jeremy9959 You can run the code base tests like this:

py.test tests/codebase

Please make sure you have also run pip install channels or else isort will get confused.

You might also want to consider adding the codebase checks as a Git commit hook. (Looking at that I see it is slightly out of date and still uses -m codebase instead of the path, an issue or quick PR to fix would be appreciated!)

⌁   Link to post

End of archived discussion · Replies are disabled