1. PyPA
  2. Python Packaging Authority Projects
  3. setuptools

Commits

Jason R. Coombs  committed d85e78b

Adding test capturing Distribute #349

  • Participants
  • Parent commits 0658153
  • Branches default

Comments (0)

Files changed (2)

File setuptools/tests/script-with-bom.py

View file
+# -*- coding: utf-8 -*-
+
+result = 'passed'

File setuptools/tests/test_sandbox.py

View file
 import shutil
 import unittest
 import tempfile
+import types
 
+import pkg_resources
+import setuptools.sandbox
 from setuptools.sandbox import DirectorySandbox, SandboxViolation
 
 def has_win32com():
             finally:
                 if os.path.exists(target): os.remove(target)
 
+    def test_setup_py_with_BOM(self):
+        """
+        It should be possible to execute a setup.py with a Byte Order Mark
+        """
+        target = pkg_resources.resource_filename(__name__,
+            'script-with-bom.py')
+        namespace = types.ModuleType('namespace')
+        setuptools.sandbox.execfile(target, vars(namespace))
+        assert namespace.result == 'passed'
+
 if __name__ == '__main__':
     unittest.main()