branch: elpa/flymake-pyrefly
commit 0ae70ca3772097d94c9b049fc506f154cb7a2d66
Author: Boris Shminke <bo...@shminke.com>
Commit: Boris Shminke <bo...@shminke.com>

    teach tests about Pyrefly bin directory (e.g. .venv/bin)
---
 tests/test-flymake-pyrefly.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/test-flymake-pyrefly.el b/tests/test-flymake-pyrefly.el
index 27bd37d51b..bd355d4607 100644
--- a/tests/test-flymake-pyrefly.el
+++ b/tests/test-flymake-pyrefly.el
@@ -22,16 +22,19 @@
 (require 'flymake)
 (ert-deftest flymake-pyrefly-test-no-pyrefly ()
   "Test error message when Pyrefly is not found."
+  (find-file "tests/example.py")
   (should-error (flymake-pyrefly 'identity)))
 (ert-deftest flymake-pyrefly-test-normal-use-case ()
   "Test a normal Pyrefly use-case."
   (defun mock-report-fn (args)
     (setq saved-args args))
-  (find-file "example.py")
+  (push (getenv "PYREFLY_BIN_DIR") exec-path)
+  (find-file "tests/example.py")
   (setq saved-args nil)
   (flymake-pyrefly 'mock-report-fn)
   (flymake-pyrefly 'mock-report-fn)
   (sleep-for 1)
+  (pop exec-path)
   (should
    (equal (aref (car saved-args) 2) (cons 2 5))))
 (ert-deftest flymake-pyrefly-test-setup ()

Reply via email to