summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/init-python.el12
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/init-python.el b/lisp/init-python.el
index 48bbf6d..dce210f 100644
--- a/lisp/init-python.el
+++ b/lisp/init-python.el
@@ -18,12 +18,12 @@ Unless a prefix argument ARG is given, py.test is also imported."
(interactive "P")
(let* ((py-file (file-name-nondirectory buffer-file-name))
(test-file (concat "test_" py-file)))
- (when (file-exists-p test-file)
- (error "Test file %s already exists." test-file))
- (with-current-buffer (find-file-other-window test-file)
- (insert (format "import %s\n" (file-name-sans-extension py-file)))
- (unless arg
- (insert "import pytest\n")))))
+ (find-file-other-window test-file)
+ (unless (file-exists-p test-file)
+ (with-current-buffer
+ (insert (format "import %s\n" (file-name-sans-extension py-file)))
+ (unless arg
+ (insert "import pytest\n"))))))
(defun km/pytest-compile (arg)
"Run pytest.