fix #521: support develop mode
diff --git a/.travis.yml b/.travis.yml
index 4fbe228..423c3a2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -40,8 +40,8 @@
     - python -m pip install .
 
 script:
-    - for test in tests/__init__.py; do echo $test ; if [[ $COVERAGE == "true" ]]; then coverage run -a $test > /dev/null; else python $test > /dev/null; fi ; done
-    - for test in tests/test_*.py; do echo $test ; if [[ $COVERAGE == "true" ]]; then coverage run -a $test > /dev/null; else python $test > /dev/null; fi ; done
+    - for test in dill/tests/__init__.py; do echo $test ; if [[ $COVERAGE == "true" ]]; then coverage run -a $test > /dev/null; else python $test > /dev/null; fi ; done
+    - for test in dill/tests/test_*.py; do echo $test ; if [[ $COVERAGE == "true" ]]; then coverage run -a $test > /dev/null; else python $test > /dev/null; fi ; done
 
 after_success:
     - if [[ $COVERAGE == "true" ]]; then bash <(curl -s https://codecov.io/bash); else echo ''; fi
diff --git a/MANIFEST.in b/MANIFEST.in
index 0cd4740..76ad622 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -4,7 +4,6 @@
 include pyproject.toml
 include tox.ini
 include scripts/*
-include tests/*py
 recursive-include docs *
 include .*
 prune .git
diff --git a/tests/__init__.py b/dill/tests/__init__.py
similarity index 100%
rename from tests/__init__.py
rename to dill/tests/__init__.py
diff --git a/tests/__main__.py b/dill/tests/__main__.py
similarity index 100%
rename from tests/__main__.py
rename to dill/tests/__main__.py
diff --git a/tests/test_check.py b/dill/tests/test_check.py
similarity index 100%
rename from tests/test_check.py
rename to dill/tests/test_check.py
diff --git a/tests/test_classdef.py b/dill/tests/test_classdef.py
similarity index 100%
rename from tests/test_classdef.py
rename to dill/tests/test_classdef.py
diff --git a/tests/test_detect.py b/dill/tests/test_detect.py
similarity index 100%
rename from tests/test_detect.py
rename to dill/tests/test_detect.py
diff --git a/tests/test_dictviews.py b/dill/tests/test_dictviews.py
similarity index 100%
rename from tests/test_dictviews.py
rename to dill/tests/test_dictviews.py
diff --git a/tests/test_diff.py b/dill/tests/test_diff.py
similarity index 100%
rename from tests/test_diff.py
rename to dill/tests/test_diff.py
diff --git a/tests/test_extendpickle.py b/dill/tests/test_extendpickle.py
similarity index 100%
rename from tests/test_extendpickle.py
rename to dill/tests/test_extendpickle.py
diff --git a/tests/test_fglobals.py b/dill/tests/test_fglobals.py
similarity index 100%
rename from tests/test_fglobals.py
rename to dill/tests/test_fglobals.py
diff --git a/tests/test_file.py b/dill/tests/test_file.py
similarity index 100%
rename from tests/test_file.py
rename to dill/tests/test_file.py
diff --git a/tests/test_functions.py b/dill/tests/test_functions.py
similarity index 100%
rename from tests/test_functions.py
rename to dill/tests/test_functions.py
diff --git a/tests/test_functors.py b/dill/tests/test_functors.py
similarity index 100%
rename from tests/test_functors.py
rename to dill/tests/test_functors.py
diff --git a/tests/test_logger.py b/dill/tests/test_logger.py
similarity index 100%
rename from tests/test_logger.py
rename to dill/tests/test_logger.py
diff --git a/tests/test_mixins.py b/dill/tests/test_mixins.py
similarity index 100%
rename from tests/test_mixins.py
rename to dill/tests/test_mixins.py
diff --git a/tests/test_module.py b/dill/tests/test_module.py
similarity index 100%
rename from tests/test_module.py
rename to dill/tests/test_module.py
diff --git a/tests/test_moduledict.py b/dill/tests/test_moduledict.py
similarity index 100%
rename from tests/test_moduledict.py
rename to dill/tests/test_moduledict.py
diff --git a/tests/test_nested.py b/dill/tests/test_nested.py
similarity index 100%
rename from tests/test_nested.py
rename to dill/tests/test_nested.py
diff --git a/tests/test_objects.py b/dill/tests/test_objects.py
similarity index 100%
rename from tests/test_objects.py
rename to dill/tests/test_objects.py
diff --git a/tests/test_properties.py b/dill/tests/test_properties.py
similarity index 100%
rename from tests/test_properties.py
rename to dill/tests/test_properties.py
diff --git a/tests/test_pycapsule.py b/dill/tests/test_pycapsule.py
similarity index 100%
rename from tests/test_pycapsule.py
rename to dill/tests/test_pycapsule.py
diff --git a/tests/test_recursive.py b/dill/tests/test_recursive.py
similarity index 100%
rename from tests/test_recursive.py
rename to dill/tests/test_recursive.py
diff --git a/tests/test_restricted.py b/dill/tests/test_restricted.py
similarity index 100%
rename from tests/test_restricted.py
rename to dill/tests/test_restricted.py
diff --git a/tests/test_selected.py b/dill/tests/test_selected.py
similarity index 100%
rename from tests/test_selected.py
rename to dill/tests/test_selected.py
diff --git a/tests/test_session.py b/dill/tests/test_session.py
similarity index 100%
rename from tests/test_session.py
rename to dill/tests/test_session.py
diff --git a/tests/test_source.py b/dill/tests/test_source.py
similarity index 100%
rename from tests/test_source.py
rename to dill/tests/test_source.py
diff --git a/tests/test_temp.py b/dill/tests/test_temp.py
similarity index 100%
rename from tests/test_temp.py
rename to dill/tests/test_temp.py
diff --git a/tests/test_weakref.py b/dill/tests/test_weakref.py
similarity index 100%
rename from tests/test_weakref.py
rename to dill/tests/test_weakref.py
diff --git a/setup.py b/setup.py
index 0d3e76c..c0716c2 100644
--- a/setup.py
+++ b/setup.py
@@ -97,7 +97,7 @@
         'Topic :: Software Development',
     ],
     packages = ['dill','dill.tests'],
-    package_dir = {'dill':'dill', 'dill.tests':'tests'},
+    package_dir = {'dill':'dill', 'dill.tests':'dill/tests'},
     scripts=['scripts/undill','scripts/get_objgraph'],
 )
 
diff --git a/tox.ini b/tox.ini
index 55b8f07..a63d806 100644
--- a/tox.ini
+++ b/tox.ini
@@ -18,5 +18,5 @@
     bash
 commands =
     {envpython} -m pip install .
-    bash -c "failed=0; for test in tests/__main__.py; do echo $test; \
+    bash -c "failed=0; for test in dill/tests/__main__.py; do echo $test; \
              {envpython} $test || failed=1; done; exit $failed"