Created
December 7, 2013 19:19
-
-
Save rcarmo/7847274 to your computer and use it in GitHub Desktop.
First stab at a plugin for running tests in hylang
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(import os sys logging nose) | |
(import [nose.plugins [Plugin]]) | |
(setv log (.getLogger logging "nose.plugins.hylang")) | |
(.setLevel log logging.DEBUG) | |
(defclass HoseTests [Plugin] | |
[[name "HoseTests"] | |
[options | |
(fn [self parser &optional [env os.environ]] | |
(.options (super HoseTests self) parser env))] | |
[configure | |
(fn [self options conf] | |
(.configure (super HoseTests self) options conf) | |
(setv self.enabled True))] | |
[finalize | |
(fn [self result] | |
(.debug log "Loaded"))] | |
[wantFile | |
(fn [self file] | |
(if (.endswith file ".hy") | |
True))] | |
[loadTestsFromModule | |
(fn [self module] | |
(.debug log "loadTestsFromModule") | |
(.debug log filename))] | |
[loadTestsFromFile | |
(fn [self filename] | |
(.debug log "loadTestsFromFile") | |
(.debug log filename) | |
; broken bits removed | |
)]]) | |
(if (= __name__ "__main__") | |
(kwapply (nose.main) {"addplugins" [(HoseTests)]})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment