File tree Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Original file line number Diff line number Diff line change 962
962
val (second bindings)]
963
963
`(try
964
964
(do
965
- (.push-bindings (var ~vvar) ~val)
965
+ (. (var ~vvar) ~'push-bindings ~val)
966
966
~@(if (nthnext bindings 2)
967
967
[(concat
968
968
(list 'binding (vec (nthrest bindings 2)))
969
969
body)]
970
970
body))
971
971
(finally
972
- (.pop-bindings (var ~vvar))))))
972
+ (. (var ~vvar) ~'pop-bindings )))))
973
973
974
974
(def ^:dynamic *in* sys/stdin)
975
975
(def ^:dynamic *out* sys/stdout)
Original file line number Diff line number Diff line change 8
8
9
9
(defn ^:private add-test!
10
10
"Add the test named by test-var to the test suite for ns."
11
- [ns test-var]
11
+ [test-var]
12
12
(swap! collected-tests conj test-var))
13
13
14
14
(defmacro is
62
62
runner using Basilisp's builtin PyTest hook."
63
63
[name-sym & body]
64
64
(let [test-name-sym (with-meta name-sym {:test true})
65
- test-name-str (name test-name-sym)]
65
+ test-name-str (name test-name-sym)
66
+ test-ns-name `(quote ~(symbol (name *ns*)))]
66
67
`(do
67
68
(defn ~test-name-sym
68
69
[]
69
- (let [~'test-name ~test-name-str
70
- ~'test-section nil
71
- ~'failures (atom [])]
72
- ~@body
73
- {:failures (deref ~'failures)}))
70
+ (binding [*ns* (the-ns ~test-ns-name)]
71
+ (let [~'test-name ~test-name-str
72
+ ~'test-section nil
73
+ ~'failures (atom [])]
74
+ ~@body
75
+ {:failures (deref ~'failures)})))
74
76
75
- (add-test! *ns* (var ~test-name-sym))
76
- (reset! current-ns *ns* ))))
77
+ (add-test! (var ~test-name-sym))
78
+ (reset! current-ns (the-ns ~test-ns-name) ))))
You can’t perform that action at this time.
0 commit comments