diff options
Diffstat (limited to 'setuptools/tests')
-rw-r--r-- | setuptools/tests/__init__.py | 4 | ||||
-rw-r--r-- | setuptools/tests/server.py | 1 | ||||
-rw-r--r-- | setuptools/tests/test_bdist_egg.py | 2 | ||||
-rw-r--r-- | setuptools/tests/test_build_ext.py | 1 | ||||
-rw-r--r-- | setuptools/tests/test_develop.py | 1 | ||||
-rw-r--r-- | setuptools/tests/test_easy_install.py | 8 | ||||
-rw-r--r-- | setuptools/tests/test_egg_info.py | 1 | ||||
-rw-r--r-- | setuptools/tests/test_find_packages.py | 1 | ||||
-rw-r--r-- | setuptools/tests/test_integration.py | 1 | ||||
-rw-r--r-- | setuptools/tests/test_manifest.py | 4 | ||||
-rw-r--r-- | setuptools/tests/test_packageindex.py | 3 | ||||
-rw-r--r-- | setuptools/tests/test_sandbox.py | 6 | ||||
-rw-r--r-- | setuptools/tests/test_sdist.py | 5 | ||||
-rw-r--r-- | setuptools/tests/test_test.py | 1 | ||||
-rw-r--r-- | setuptools/tests/test_upload_docs.py | 2 | ||||
-rw-r--r-- | setuptools/tests/test_windows_wrappers.py | 2 |
16 files changed, 5 insertions, 38 deletions
diff --git a/setuptools/tests/__init__.py b/setuptools/tests/__init__.py index 53bd836c..dbf16201 100644 --- a/setuptools/tests/__init__.py +++ b/setuptools/tests/__init__.py @@ -42,7 +42,6 @@ needs_bytecode = pytest.mark.skipif( class TestDepends: - def testExtractConst(self): if not hasattr(dep, 'extract_constant'): # skip on non-bytecode platforms @@ -123,7 +122,6 @@ class TestDepends: class TestDistro: - def setup_method(self, method): self.e1 = Extension('bar.ext', ['bar.c']) self.e2 = Extension('c.y', ['y.c']) @@ -214,7 +212,6 @@ class TestDistro: class TestFeatures: - def setup_method(self, method): self.req = Require('Distutils', '1.0.3', 'distutils') self.dist = makeSetup( @@ -292,7 +289,6 @@ class TestFeatures: class TestCommandTests: - def testTestIsCommand(self): test_cmd = makeSetup().get_command_obj('test') assert (isinstance(test_cmd, distutils.cmd.Command)) diff --git a/setuptools/tests/server.py b/setuptools/tests/server.py index 9e5fefb7..35312120 100644 --- a/setuptools/tests/server.py +++ b/setuptools/tests/server.py @@ -45,7 +45,6 @@ class IndexServer(BaseHTTPServer.HTTPServer): class RequestRecorder(BaseHTTPServer.BaseHTTPRequestHandler): - def do_GET(self): requests = vars(self.server).setdefault('requests', []) requests.append(self) diff --git a/setuptools/tests/test_bdist_egg.py b/setuptools/tests/test_bdist_egg.py index c77aa226..5aabf404 100644 --- a/setuptools/tests/test_bdist_egg.py +++ b/setuptools/tests/test_bdist_egg.py @@ -9,7 +9,6 @@ from setuptools.dist import Distribution from . import contexts - SETUP_PY = """\ from setuptools import setup @@ -28,7 +27,6 @@ def setup_context(tmpdir): class Test: - def test_bdist_egg(self, setup_context, user_override): dist = Distribution(dict( script_name='setup.py', diff --git a/setuptools/tests/test_build_ext.py b/setuptools/tests/test_build_ext.py index ac002f44..60257154 100644 --- a/setuptools/tests/test_build_ext.py +++ b/setuptools/tests/test_build_ext.py @@ -10,7 +10,6 @@ from setuptools.extension import Extension class TestBuildExt: - def test_get_ext_filename(self): """ Setuptools needs to give back the same diff --git a/setuptools/tests/test_develop.py b/setuptools/tests/test_develop.py index f1580785..4cf483f2 100644 --- a/setuptools/tests/test_develop.py +++ b/setuptools/tests/test_develop.py @@ -13,7 +13,6 @@ from setuptools.command.develop import develop from setuptools.dist import Distribution from . import contexts - SETUP_PY = """\ from setuptools import setup diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py index 82e1d7e8..209e6b78 100644 --- a/setuptools/tests/test_easy_install.py +++ b/setuptools/tests/test_easy_install.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- - """Easy install Tests """ from __future__ import absolute_import @@ -42,7 +41,6 @@ from .textwrap import DALS class FakeDist(object): - def get_entry_map(self, group): if group != 'console_scripts': return {} @@ -60,7 +58,6 @@ SETUP_PY = DALS(""" class TestEasyInstallTest: - def test_install_site_py(self, tmpdir): dist = Distribution() cmd = ei.easy_install(dist) @@ -194,7 +191,6 @@ class TestEasyInstallTest: class TestPTHFileWriter: - def test_add_from_cwd_site_sets_dirty(self): '''a pth file manager should set dirty if a distribution is in site but also the cwd @@ -328,13 +324,11 @@ def distutils_package(): class TestDistutilsPackage: - def test_bdist_egg_available_on_distutils_pkg(self, distutils_package): run_setup('setup.py', ['bdist_egg']) class TestSetupRequires: - def test_setup_requires_honors_fetch_params(self): """ When easy_install installs a source distribution which specifies @@ -623,7 +617,6 @@ class TestScriptHeader: class TestCommandSpec: - def test_custom_launch_command(self): """ Show how a custom CommandSpec could be used to specify a #! executable @@ -659,7 +652,6 @@ class TestCommandSpec: class TestWindowsScriptWriter: - def test_header(self): hdr = ei.WindowsScriptWriter.get_script_header('') assert hdr.startswith('#!') diff --git a/setuptools/tests/test_egg_info.py b/setuptools/tests/test_egg_info.py index 4c767826..12c10497 100644 --- a/setuptools/tests/test_egg_info.py +++ b/setuptools/tests/test_egg_info.py @@ -262,7 +262,6 @@ class TestEggInfo(object): def _find_egg_info_files(self, root): class DirList(list): - def __init__(self, files, base): super(DirList, self).__init__(files) self.base = base diff --git a/setuptools/tests/test_find_packages.py b/setuptools/tests/test_find_packages.py index 6dc1b3ac..a6023de9 100644 --- a/setuptools/tests/test_find_packages.py +++ b/setuptools/tests/test_find_packages.py @@ -38,7 +38,6 @@ def has_symlink(): class TestFindPackages: - def setup_method(self, method): self.dist_dir = tempfile.mkdtemp() self._make_pkg_structure() diff --git a/setuptools/tests/test_integration.py b/setuptools/tests/test_integration.py index 04772ba5..78fb0627 100644 --- a/setuptools/tests/test_integration.py +++ b/setuptools/tests/test_integration.py @@ -49,6 +49,7 @@ def install_context(request, tmpdir, monkeypatch): user_base.remove() user_site.remove() install_dir.remove() + request.addfinalizer(fin) # Change the environment and site settings to control where the diff --git a/setuptools/tests/test_manifest.py b/setuptools/tests/test_manifest.py index 8bcf4f5c..602c43a2 100644 --- a/setuptools/tests/test_manifest.py +++ b/setuptools/tests/test_manifest.py @@ -30,7 +30,6 @@ SETUP_ATTRS = { 'packages': ['app'], } - SETUP_PY = """\ from setuptools import setup @@ -95,7 +94,6 @@ def test_translated_pattern_test(): class TempDirTestCase(object): - def setup_method(self, method): self.temp_dir = tempfile.mkdtemp() self.old_cwd = os.getcwd() @@ -107,14 +105,12 @@ class TempDirTestCase(object): class TestManifestTest(TempDirTestCase): - def setup_method(self, method): super(TestManifestTest, self).setup_method(method) f = open(os.path.join(self.temp_dir, 'setup.py'), 'w') f.write(SETUP_PY) f.close() - """ Create a file tree like: - LICENSE diff --git a/setuptools/tests/test_packageindex.py b/setuptools/tests/test_packageindex.py index f9bf895b..f09dd78c 100644 --- a/setuptools/tests/test_packageindex.py +++ b/setuptools/tests/test_packageindex.py @@ -14,7 +14,6 @@ from .textwrap import DALS class TestPackageIndex: - def test_regex(self): hash_url = 'http://other_url?:action=show_md5&' hash_url += 'digest=0123456789abcdef0123456789abcdef' @@ -184,7 +183,6 @@ class TestPackageIndex: class TestContentCheckers: - def test_md5(self): checker = setuptools.package_index.HashChecker.from_url( 'http://foo/bar#md5=f12895fdffbd45007040d2e44df98478') @@ -219,7 +217,6 @@ class TestContentCheckers: class TestPyPIConfig: - def test_percent_in_password(self, tmpdir, monkeypatch): monkeypatch.setitem(os.environ, 'HOME', str(tmpdir)) pypirc = tmpdir / '.pypirc' diff --git a/setuptools/tests/test_sandbox.py b/setuptools/tests/test_sandbox.py index aa6138e4..b92a477a 100644 --- a/setuptools/tests/test_sandbox.py +++ b/setuptools/tests/test_sandbox.py @@ -11,7 +11,6 @@ from setuptools.sandbox import DirectorySandbox class TestSandbox: - def test_devnull(self, tmpdir): sandbox = DirectorySandbox(str(tmpdir)) sandbox.run(self._file_writer(os.devnull)) @@ -21,6 +20,7 @@ class TestSandbox: def do_write(): with open(path, 'w') as f: f.write('xxx') + return do_write def test_win32com(self, tmpdir): @@ -57,7 +57,6 @@ class TestSandbox: class TestExceptionSaver: - def test_exception_trapped(self): with setuptools.sandbox.ExceptionSaver(): raise ValueError("details") @@ -107,6 +106,7 @@ class TestExceptionSaver: As revealed in #440, an infinite recursion can occur if an unpickleable exception while setuptools is hidden. Ensure this doesn't happen. """ + class ExceptionUnderTest(Exception): """ An unpickleable exception (not in globals). @@ -126,10 +126,12 @@ class TestExceptionSaver: should reflect a proper exception and not be wrapped in an UnpickleableException. """ + def write_file(): "Trigger a SandboxViolation by writing outside the sandbox" with open('/etc/foo', 'w'): pass + sandbox = DirectorySandbox(str(tmpdir)) with pytest.raises(setuptools.sandbox.SandboxViolation) as caught: with setuptools.sandbox.save_modules(): diff --git a/setuptools/tests/test_sdist.py b/setuptools/tests/test_sdist.py index 16d0eb07..609c7830 100644 --- a/setuptools/tests/test_sdist.py +++ b/setuptools/tests/test_sdist.py @@ -20,10 +20,8 @@ from setuptools.command.egg_info import manifest_maker from setuptools.dist import Distribution from setuptools.tests import fail_on_ascii - py3_only = pytest.mark.xfail(six.PY2, reason="Test runs on Python 3 only") - SETUP_ATTRS = { 'name': 'sdist_test', 'version': '0.0', @@ -31,14 +29,12 @@ SETUP_ATTRS = { 'package_data': {'sdist_test': ['*.txt']} } - SETUP_PY = """\ from setuptools import setup setup(**%r) """ % SETUP_ATTRS - if six.PY3: LATIN1_FILENAME = 'smörbröd.py'.encode('latin-1') else: @@ -90,7 +86,6 @@ def read_all_bytes(filename): class TestSdistTest: - def setup_method(self, method): self.temp_dir = tempfile.mkdtemp() f = open(os.path.join(self.temp_dir, 'setup.py'), 'w') diff --git a/setuptools/tests/test_test.py b/setuptools/tests/test_test.py index 4155a5b1..7ea43c57 100644 --- a/setuptools/tests/test_test.py +++ b/setuptools/tests/test_test.py @@ -70,7 +70,6 @@ def sample_test(tmpdir_cwd): @pytest.mark.usefixtures('user_override') @pytest.mark.usefixtures('sample_test') class TestTestTest: - def test_test(self): params = dict( name='foo', diff --git a/setuptools/tests/test_upload_docs.py b/setuptools/tests/test_upload_docs.py index d3dee616..5d50bb0b 100644 --- a/setuptools/tests/test_upload_docs.py +++ b/setuptools/tests/test_upload_docs.py @@ -10,7 +10,6 @@ from setuptools.dist import Distribution from .textwrap import DALS from . import contexts - SETUP_PY = DALS( """ from setuptools import setup @@ -38,7 +37,6 @@ def sample_project(tmpdir_cwd): @pytest.mark.usefixtures('sample_project') @pytest.mark.usefixtures('user_override') class TestUploadDocsTest: - def test_create_zipfile(self): """ Ensure zipfile creation handles common cases, including a folder diff --git a/setuptools/tests/test_windows_wrappers.py b/setuptools/tests/test_windows_wrappers.py index 5b14d07b..d2871c0f 100644 --- a/setuptools/tests/test_windows_wrappers.py +++ b/setuptools/tests/test_windows_wrappers.py @@ -23,12 +23,10 @@ import pytest from setuptools.command.easy_install import nt_quote_arg import pkg_resources - pytestmark = pytest.mark.skipif(sys.platform != 'win32', reason="Windows only") class WrapperTester: - @classmethod def prep_script(cls, template): python_exe = nt_quote_arg(sys.executable) |