From f250beb8aac83009c70ff01ae8568384683d0f3c Mon Sep 17 00:00:00 2001 From: Stas Bekman Date: Fri, 31 Jul 2020 01:34:46 -0700 Subject: [PATCH] enable easy checkout switch (#5645) * enable easy checkout switch allow having multiple repository checkouts and not needing to remember to rerun 'pip install -e .[dev]' when switching between checkouts and running tests. * make isort happy * examples needs one too --- examples/conftest.py | 11 +++++++++++ tests/conftest.py | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100644 examples/conftest.py create mode 100644 tests/conftest.py diff --git a/examples/conftest.py b/examples/conftest.py new file mode 100644 index 0000000000..0a83207cb5 --- /dev/null +++ b/examples/conftest.py @@ -0,0 +1,11 @@ +# tests directory-specific settings - this file is run automatically +# by pytest before any tests are run + +import sys +from os.path import abspath, dirname, join + + +# allow having multiple repository checkouts and not needing to remember to rerun +# 'pip install -e .[dev]' when switching between checkouts and running tests. +git_repo_path = abspath(join(dirname(dirname(__file__)), "src")) +sys.path.insert(1, git_repo_path) diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000000..0a83207cb5 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,11 @@ +# tests directory-specific settings - this file is run automatically +# by pytest before any tests are run + +import sys +from os.path import abspath, dirname, join + + +# allow having multiple repository checkouts and not needing to remember to rerun +# 'pip install -e .[dev]' when switching between checkouts and running tests. +git_repo_path = abspath(join(dirname(dirname(__file__)), "src")) +sys.path.insert(1, git_repo_path)