Browse Source

Move test helpers into subdirectory

tags/nilmdb-0.1
Jim Paris 9 years ago
parent
commit
3d212e7592
18 changed files with 21 additions and 19 deletions
  1. +1
    -1
      setup.cfg
  2. +1
    -1
      tests/test_bulkdata.py
  3. +1
    -1
      tests/test_client.py
  4. +1
    -1
      tests/test_cmdline.py
  5. +6
    -5
      tests/test_interval.py
  6. +1
    -1
      tests/test_iteratorizer.py
  7. +1
    -1
      tests/test_layout.py
  8. +1
    -1
      tests/test_lrucache.py
  9. +1
    -1
      tests/test_mustclose.py
  10. +1
    -1
      tests/test_nilmdb.py
  11. +1
    -1
      tests/test_printf.py
  12. +2
    -2
      tests/test_rbtree.py
  13. +1
    -1
      tests/test_serializer.py
  14. +1
    -1
      tests/test_timestamper.py
  15. +1
    -0
      tests/testutil/__init__.py
  16. +0
    -0
      tests/testutil/aplotter.py
  17. +0
    -0
      tests/testutil/helpers.py
  18. +0
    -0
      tests/testutil/renderdot.py

+ 1
- 1
setup.cfg View File

@@ -4,7 +4,7 @@ nocapture=
nologcapture= # comment to see cherrypy logs on failure
with-coverage=
cover-inclusive=
cover-package=nilmdb #.bulkdata
cover-package=nilmdb
cover-erase=
##cover-html= # this works, puts html output in cover/ dir
##cover-branches= # need nose 1.1.3 for this


+ 1
- 1
tests/test_bulkdata.py View File

@@ -8,7 +8,7 @@ from nose.tools import *
from nose.tools import assert_raises
import itertools

from test_helpers import *
from testutil.helpers import *

testdb = "tests/bulkdata-testdb"



+ 1
- 1
tests/test_client.py View File

@@ -19,7 +19,7 @@ import unittest
import warnings
import resource

from test_helpers import *
from testutil.helpers import *

testdb = "tests/client-testdb"



+ 1
- 1
tests/test_cmdline.py View File

@@ -18,7 +18,7 @@ import Queue
import StringIO
import shlex

from test_helpers import *
from testutil.helpers import *

testdb = "tests/cmdline-testdb"



+ 6
- 5
tests/test_interval.py View File

@@ -10,13 +10,13 @@ import itertools

from nilmdb.interval import Interval, DBInterval, IntervalSet, IntervalError

from test_helpers import *
from testutil.helpers import *
import unittest

# set to False to skip live renders
do_live_renders = False
def render(iset, description = "", live = True):
import renderdot
import testutil.renderdot as renderdot
r = renderdot.RBTreeRenderer(iset.tree)
return r.render(description, live and do_live_renders)

@@ -341,18 +341,19 @@ class TestIntervalTree:
render(iset, "In-order insertion")

class TestIntervalSpeed:
@unittest.skip("this is slow")
#@unittest.skip("this is slow")
def test_interval_speed(self):
import yappi
import time
import aplotter
import testutil.aplotter as aplotter
import random
import math

print
yappi.start()
speeds = {}
for j in [ 2**x for x in range(5,20) ]:
limit = 10 # was 20
for j in [ 2**x for x in range(5,limit) ]:
start = time.time()
iset = IntervalSet()
for i in random.sample(xrange(j),j):


+ 1
- 1
tests/test_iteratorizer.py View File

@@ -7,7 +7,7 @@ from nose.tools import assert_raises
import threading
import time

from test_helpers import *
from testutil.helpers import *

def func_with_callback(a, b, callback):
callback(a)


+ 1
- 1
tests/test_layout.py View File

@@ -20,7 +20,7 @@ import cStringIO
import random
import unittest

from test_helpers import *
from testutil.helpers import *

from nilmdb.layout import *



+ 1
- 1
tests/test_lrucache.py View File

@@ -7,7 +7,7 @@ from nose.tools import assert_raises
import threading
import time

from test_helpers import *
from testutil.helpers import *

@nilmdb.utils.lru_cache(size = 3)
def foo1(n):


+ 1
- 1
tests/test_mustclose.py View File

@@ -5,7 +5,7 @@ import nose
from nose.tools import *
from nose.tools import assert_raises

from test_helpers import *
from testutil.helpers import *

import sys
import cStringIO


+ 1
- 1
tests/test_nilmdb.py View File

@@ -22,7 +22,7 @@ testdb = "tests/testdb"
#def cleanup():
# os.unlink(testdb)

from test_helpers import *
from testutil.helpers import *

class Test00Nilmdb(object): # named 00 so it runs first
def test_NilmDB(self):


+ 1
- 1
tests/test_printf.py View File

@@ -6,7 +6,7 @@ from nose.tools import assert_raises
from cStringIO import StringIO
import sys

from test_helpers import *
from testutil.helpers import *

class TestPrintf(object):
def test_printf(self):


+ 2
- 2
tests/test_rbtree.py View File

@@ -8,13 +8,13 @@ from nose.tools import assert_raises

from nilmdb.rbtree import RBTree, RBNode

from test_helpers import *
from testutil.helpers import *
import unittest

# set to False to skip live renders
do_live_renders = False
def render(tree, description = "", live = True):
import renderdot
import testutil.renderdot as renderdot
r = renderdot.RBTreeRenderer(tree)
return r.render(description, live and do_live_renders)



+ 1
- 1
tests/test_serializer.py View File

@@ -7,7 +7,7 @@ from nose.tools import assert_raises
import threading
import time

from test_helpers import *
from testutil.helpers import *

#raise nose.exc.SkipTest("Skip these")



+ 1
- 1
tests/test_timestamper.py View File

@@ -9,7 +9,7 @@ import os
import sys
import cStringIO

from test_helpers import *
from testutil.helpers import *

class TestTimestamper(object):



+ 1
- 0
tests/testutil/__init__.py View File

@@ -0,0 +1 @@
# empty

tests/aplotter.py → tests/testutil/aplotter.py View File


tests/test_helpers.py → tests/testutil/helpers.py View File


tests/renderdot.py → tests/testutil/renderdot.py View File


Loading…
Cancel
Save