Open sr105 opened 6 years ago
In .emacs:
(defun pytest-find-project-root-or-current-dir (orig-fn &rest args)
(or (apply orig-fn args)
(file-name-directory buffer-file-name)))
(advice-add 'pytest-find-project-root :around 'pytest-find-project-root-or-current-dir)
I don't know elisp well enough to know if there's a better way to do this (hence an issue and not a pull request). This code returns the directory of the current buffer if there isn't a project root. That way, I can write tests in a single file where I'm just testing out some code.
Untouched; only changed the name.
Try to find a project root and fall back to the current directory.