Ticket #5129: py3-execfile-5129.apply-to-r34464.diff
| File py3-execfile-5129.apply-to-r34464.diff, 1.6 KB (added by allenap, 12 months ago) |
|---|
-
twisted/python/test/test_dist.py
8 8 9 9 import os 10 10 import shutil 11 import sys 11 12 12 13 from distutils.core import Distribution 13 14 … … 88 89 setup.setContent(self.setupTemplate % (name,)) 89 90 90 91 92 def writeEmptySetup(self, *path): 93 """ 94 Write out an empty C{setup.py} file to a location determined by 95 L{self.basedir} and L{path}. 96 """ 97 outdir = self.basedir.descendant(path) 98 outdir.makedirs() 99 outdir.child("setup.py").setContent("") 100 101 91 102 def assertExtensions(self, expected): 92 103 """ 93 104 Assert that the given names match the (sorted) names of discovered … … 127 138 self.assertExtensions([]) 128 139 129 140 141 def test_getExtensionsNotSupportedOnJava(self): 142 """ 143 Extensions are not supported on Java-based platforms. 144 """ 145 self.addCleanup(setattr, sys, "platform", sys.platform) 146 sys.platform = "java" 147 self.writeSetup("twisted.sorcery", "topfiles") 148 self.assertExtensions([]) 130 149 150 151 def test_getExtensionsExtensionsLocalIsOptional(self): 152 """ 153 It is acceptable for extensions to not define the C{extensions} local 154 variable. 155 """ 156 self.writeEmptySetup("twisted.necromancy", "topfiles") 157 self.assertExtensions([]) 158 159 160 131 161 class GetVersionTest(TestCase): 132 162 """ 133 163 Tests for L{dist.getVersion}.
