Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Runtest cleanup for different testing environments.

  • Loading branch information...
commit 6c95459c95f1250fc6ee7e153f7fdc30d3f99ed9 1 parent 521f3bb
Robert Bradshaw robertwb authored

Showing 1 changed file with 7 additions and 6 deletions. Show diff stats Hide diff stats

  1. +7 6 runtests.py
13 runtests.py
@@ -177,7 +177,8 @@ def build_suite(self):
177 177 self.handle_directory(path, filename))
178 178 if sys.platform not in ['win32'] and sys.version_info[0] < 3:
179 179 # Non-Windows makefile, can't run Cython under Py3.
180   - if [1 for selector in self.selectors if selector("embedded")]:
  180 + if [1 for selector in self.selectors if selector("embedded")] \
  181 + and not [1 for selector in self.exclude_selectors if selector("embedded")]:
181 182 suite.addTest(unittest.makeSuite(EmbedTest))
182 183 return suite
183 184
@@ -194,7 +195,7 @@ def handle_directory(self, path, context):
194 195 if context == "build" and filename.endswith(".srctree"):
195 196 if not [ 1 for match in self.selectors if match(filename) ]:
196 197 continue
197   - suite.addTest(EndToEndTest(filename, workdir, self.cleanup_workdir))
  198 + suite.addTest(EndToEndTest(os.path.join(path, filename), workdir, self.cleanup_workdir))
198 199 continue
199 200 if not (filename.endswith(".pyx") or filename.endswith(".py")):
200 201 continue
@@ -786,8 +787,9 @@ class EndToEndTest(unittest.TestCase):
786 787 cython_root = os.path.dirname(os.path.abspath(__file__))
787 788
788 789 def __init__(self, treefile, workdir, cleanup_workdir=True):
  790 + self.name = os.path.splitext(os.path.basename(treefile))[0]
789 791 self.treefile = treefile
790   - self.workdir = os.path.join(workdir, os.path.splitext(treefile)[0])
  792 + self.workdir = os.path.join(workdir, self.name)
791 793 self.cleanup_workdir = cleanup_workdir
792 794 cython_syspath = self.cython_root
793 795 for path in sys.path[::-1]:
@@ -800,12 +802,11 @@ def __init__(self, treefile, workdir, cleanup_workdir=True):
800 802 unittest.TestCase.__init__(self)
801 803
802 804 def shortDescription(self):
803   - return "End-to-end %s" % self.treefile
  805 + return "End-to-end %s" % self.name
804 806
805 807 def setUp(self):
806 808 from Cython.TestUtils import unpack_source_tree
807   - _, self.commands = unpack_source_tree(
808   - os.path.join('tests', 'build', self.treefile), self.workdir)
  809 + _, self.commands = unpack_source_tree(self.treefile, self.workdir)
809 810 self.old_dir = os.getcwd()
810 811 os.chdir(self.workdir)
811 812 if self.workdir not in sys.path:

0 comments on commit 6c95459

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