ipython_pytest icon indicating copy to clipboard operation
ipython_pytest copied to clipboard

Setting/Emulating nested conftest.py folder structure?

Open patrickkidd opened this issue 4 years ago • 1 comments

Gret project. I am trying to prototype individual tests without waiting the 15s to spin up our entire app with necessary db connections etc - ours is a large project. It looks like a notebook would be great for this.

How can I get my notebook to behave as if it is in a certain subfolder in our test suite? I need to gain access to all the fixtures in the current folder and all folders above, as pytest normally does. Example:

project_root/tests/conftest.py project_root/tests/module_a/conftest.py project_root/tests/module_a/component_1/conftest.py project_root/tests/module_a/component_1/test_mymethod.py <-- I want my notebook to run as if it's in this folder, inheriting fixtures from all three conftest.py.

How to do that?

patrickkidd avatar Jan 14 '22 20:01 patrickkidd

Thanks for the idea @patrickkidd! Could you check whether #3 works for you?

akaihola avatar Jan 18 '22 20:01 akaihola