Skip to content

Difference between running with testbook(execute=True) and converting to python and running with nbconvert? #160

Description

@dyollb

I am having trouble using testbook.

I am running some functions, which require that a context is setup in the same thread (and process).
I have a pytest fixture (scope="session", autouse=True) to initialize the context.

  • When I run the notebook using testbook it looks like the context is not setup.
  • If I run the same notebook (by converting it to Python code using nbconvert.PythonExporter) using runpy, it works as expected

Am I missing some configuration or execution policy option? Or is my fixture injected in the wrong order?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions