Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Require nose for run

--HG--
branch : sneakylang
  • Loading branch information...
commit 15c62631a7b9cfeff7c05f2c66743e2f7227122f 1 parent 78dff16
almad authored

Showing 1 changed file with 2 additions and 48 deletions. Show diff stats Hide diff stats

  1. +2 48 sneakylang/test/run.py
50 sneakylang/test/run.py
... ... @@ -1,52 +1,6 @@
1 1 #!/usr/bin/env python
2   -# -*- coding: utf-8 -*-
3 2
4   -import unittest
5   -import imp
6   -import os
7   -import sys
8   -
9   -os.chdir(os.path.dirname(os.path.abspath(__file__)))
10   -
11   -def getSuites():
12   - tests = []
13   - for i in os.listdir(os.curdir):
14   - if i.startswith("test_") and i.endswith(".py"):
15   - tests.append(imp.load_source(i[5:-3], i))
16   - return tests
17   -
18   -def runTests(tests):
19   - loader = unittest.TestLoader()
20   - suite = unittest.TestSuite()
21   - for test in tests:
22   - testSuite = loader.loadTestsFromModule(test)
23   - suite.addTests(testSuite)
24   - unittest.TextTestRunner(verbosity=1, descriptions=1).run(suite)
25   -
26   -def main():
27   - try:
28   - import nose
29   - cover = False
30   - if len(sys.argv) > 1 and sys.argv[1] == "-c":
31   - import coverage
32   - coverage.start()
33   - cover = True
34   - del sys.argv[1]
35   - nose.run()
36   - if cover:
37   - coverage.stop()
38   - moduleList = [mod for name, mod in sys.modules.copy().iteritems()
39   - if getattr(mod, '__file__', None) and
40   - name.startswith('sneakylang.') and
41   - 'test' not in name
42   - ]
43   - moduleList.sort()
44   - coverage.report(moduleList)
45   -
46   - except ImportError:
47   - # dirty unittest run
48   - tests = getSuites()
49   - runTests(tests)
  3 +import nose
50 4
51 5 if __name__ == "__main__":
52   - main()
  6 + nose.run_exit()

0 comments on commit 15c6263

Please sign in to comment.
Something went wrong with that request. Please try again.