I'm using nosetests to test python code with the convenient C-x C-t test command. However it seems that the package root is not found correctly when working with namespace packages. Currently the package root is found on the same path as the current buffer path. That affects where the nosetests start to look for test cases.
Below is temporal fix that I made.
The temp fix requires setup.py or setup.cfg in the root of packages
Below is the small change done to the elpy.el code
(defun elpy-library-root ()
"Return the root of the Python package chain of the current buffer.
That is, if you have /foo/package/module.py, it will return /foo,
so that import package.module will pick up module.py."
(elpy-project-find-python-root))
;; (locate-dominating-file default-directory
;; (λ (dir)
;; (not (file-exists-p
;; (format "%s/__init__.py"
;; dir))))))
Hi
I'm using nosetests to test python code with the convenient C-x C-t test command. However it seems that the package root is not found correctly when working with namespace packages. Currently the package root is found on the same path as the current buffer path. That affects where the nosetests start to look for test cases.
Below is temporal fix that I made.
The temp fix requires setup.py or setup.cfg in the root of packages
Below is the small change done to the elpy.el code