[Pkg-privacy-commits] [pyptlib] 78/136: add test_suite to setuptools config so `python setup.py test` works, remove obsolete Makefile

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 13:25:12 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository pyptlib.

commit cd64f717c736a71b1128f5964e6adf5de8942561
Author: Ximin Luo <infinity0 at gmx.com>
Date:   Thu Aug 15 15:23:56 2013 +0100

    add test_suite to setuptools config so `python setup.py test` works, remove obsolete Makefile
---
 Makefile                          | 14 --------------
 pyptlib/{ => test}/__init__.py    |  0
 pyptlib/test/test_util_subproc.py |  2 +-
 pyptlib/test/util_subproc_main.py |  2 +-
 setup.py                          | 21 +++++++++++----------
 5 files changed, 13 insertions(+), 26 deletions(-)

diff --git a/Makefile b/Makefile
deleted file mode 100644
index 3d9f1ee..0000000
--- a/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-# This is only an ad-hoc way for running multi-language tests.
-# Use setup.py for building/distributing.
-
-TEST_DIR = pyptlib/test
-BASE_DIR = $(realpath .)
-PYTHONPATH = $(BASE_DIR):$(realpath $(TEST_DIR))
-
-.PHONY: check check_py check_sh
-
-check: check_py check_sh
-
-check_py: $(TEST_DIR)/test_*.py
-	export PYTHONPATH=$(PYTHONPATH); cd $(TEST_DIR); \
-	  for i in $^; do python "$${i#$(TEST_DIR)/}" || exit 1; done
diff --git a/pyptlib/__init__.py b/pyptlib/test/__init__.py
similarity index 100%
copy from pyptlib/__init__.py
copy to pyptlib/test/__init__.py
diff --git a/pyptlib/test/test_util_subproc.py b/pyptlib/test/test_util_subproc.py
index 9100127..b3a683a 100644
--- a/pyptlib/test/test_util_subproc.py
+++ b/pyptlib/test/test_util_subproc.py
@@ -20,7 +20,7 @@ class SubprocTest(unittest.TestCase):
         return self.id().split(".")[-1].replace("test_", "")
 
     def getMainArgs(self):
-        return ["python", "./util_subproc_main.py", self.name()]
+        return ["python", "-m" "pyptlib.test.util_subproc_main", self.name()]
 
     def spawnMain(self, cmd=None, stdout=PIPE, **kwargs):
         # spawn the main test process and wait a bit for it to initialise
diff --git a/pyptlib/test/util_subproc_main.py b/pyptlib/test/util_subproc_main.py
index f2ead66..0231ace 100644
--- a/pyptlib/test/util_subproc_main.py
+++ b/pyptlib/test/util_subproc_main.py
@@ -11,7 +11,7 @@ from subprocess import PIPE
 
 def startChild(subcmd, report=False, stdout=SINK, **kwargs):
     proc = Popen(
-        ["python", "util_subproc_child.py", subcmd],
+        ["python", "-m", "pyptlib.test.util_subproc_child", subcmd],
         stdout = stdout,
         **kwargs
     )
diff --git a/setup.py b/setup.py
index 6fabc51..0a14159 100644
--- a/setup.py
+++ b/setup.py
@@ -11,18 +11,19 @@ setup(name='pyptlib',
       author='asn, Brandon Wiley',
       author_email='asn at torproject.org, brandon at blanu.net',
       classifiers=[
-	"Development Status :: 3 - Alpha",
-    	"Environment :: No Input/Output (Daemon)",
-    	"License :: OSI Approved :: BSD License",
-    	"Programming Language :: Python",
-    	"Intended Audience :: Developers",
-    	"Operating System :: OS Independent",
-    	"Topic :: Internet",
-    	"Topic :: Security :: Cryptography",
-    	"Topic :: Software Development :: Libraries :: Python Modules",
+        "Development Status :: 3 - Alpha",
+        "Environment :: No Input/Output (Daemon)",
+        "License :: OSI Approved :: BSD License",
+        "Programming Language :: Python",
+        "Intended Audience :: Developers",
+        "Operating System :: OS Independent",
+        "Topic :: Internet",
+        "Topic :: Security :: Cryptography",
+        "Topic :: Software Development :: Libraries :: Python Modules",
       ],
       keywords='cryptography privacy internet',
       license='BSD',
       package_dir={'pyptlib': 'pyptlib'},
-      packages=find_packages(),
+      packages=find_packages(exclude=['*.test']),
+      test_suite='pyptlib.test',
      )

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/pyptlib.git



More information about the Pkg-privacy-commits mailing list