caa53fb095
This also breaks out the PY3 only tests into their own file. We need to do this because raise from is a syntax error in PY2, so we can't rely on the previous hack of catching a HyCompileError - it would compile fine through Hy and then be a syntax error in Python.
16 lines
500 B
Hy
16 lines
500 B
Hy
;; Tests where the emited code relies on Python 3.
|
|
;; Conditionally included in nosetests runs.
|
|
|
|
(defn test-yield-from []
|
|
"NATIVE: testing yield from"
|
|
(do (defn yield-from-test []
|
|
(for* [i (range 3)]
|
|
(yield i))
|
|
(yield-from [1 2 3]))
|
|
(assert (= (list (yield-from-test)) [0 1 2 1 2 3]))))
|
|
|
|
(defn test-exception-cause []
|
|
(try (raise ValueError :from NameError)
|
|
(except [e [ValueError]]
|
|
(assert (= (type (. e __cause__)) NameError)))))
|