diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2020-01-05 00:53:30 -0500 |
---|---|---|
committer | Warren Weckesser <warren.weckesser@gmail.com> | 2020-01-05 00:53:30 -0500 |
commit | c31cc36a8a814ed4844a2a553454185601914a5a (patch) | |
tree | adb28a762dc0985eed669db75b564b3f5c3bfbcc /numpy/distutils/tests | |
parent | c1f1bc9ce8e4e2936e80d9bfafc3d8e03237a84b (diff) | |
download | numpy-c31cc36a8a814ed4844a2a553454185601914a5a.tar.gz |
MAINT: Remove implicit inheritance from object class (#15236)
Inheriting from object was necessary for Python 2 compatibility to use
new-style classes. In Python 3, this is unnecessary as there are no
old-style classes.
Dropping the object is more idiomatic Python.
Diffstat (limited to 'numpy/distutils/tests')
-rw-r--r-- | numpy/distutils/tests/test_exec_command.py | 8 | ||||
-rw-r--r-- | numpy/distutils/tests/test_fcompiler_gnu.py | 4 | ||||
-rw-r--r-- | numpy/distutils/tests/test_fcompiler_intel.py | 4 | ||||
-rw-r--r-- | numpy/distutils/tests/test_fcompiler_nagfor.py | 2 | ||||
-rw-r--r-- | numpy/distutils/tests/test_misc_util.py | 8 | ||||
-rw-r--r-- | numpy/distutils/tests/test_npy_pkg_config.py | 4 | ||||
-rw-r--r-- | numpy/distutils/tests/test_system_info.py | 2 |
7 files changed, 16 insertions, 16 deletions
diff --git a/numpy/distutils/tests/test_exec_command.py b/numpy/distutils/tests/test_exec_command.py index 8c3a4516a..2ac0a6308 100644 --- a/numpy/distutils/tests/test_exec_command.py +++ b/numpy/distutils/tests/test_exec_command.py @@ -13,7 +13,7 @@ if sys.version_info[0] >= 3: else: from StringIO import StringIO -class redirect_stdout(object): +class redirect_stdout: """Context manager to redirect stdout for exec_command test.""" def __init__(self, stdout=None): self._stdout = stdout or sys.stdout @@ -28,7 +28,7 @@ class redirect_stdout(object): # note: closing sys.stdout won't close it. self._stdout.close() -class redirect_stderr(object): +class redirect_stderr: """Context manager to redirect stderr for exec_command test.""" def __init__(self, stderr=None): self._stderr = stderr or sys.stderr @@ -43,7 +43,7 @@ class redirect_stderr(object): # note: closing sys.stderr won't close it. self._stderr.close() -class emulate_nonposix(object): +class emulate_nonposix: """Context manager to emulate os.name != 'posix' """ def __init__(self, osname='non-posix'): self._new_name = osname @@ -96,7 +96,7 @@ def test_exec_command_stderr(): exec_command.exec_command("cd '.'") -class TestExecCommand(object): +class TestExecCommand: def setup(self): self.pyexe = get_pythonexe() diff --git a/numpy/distutils/tests/test_fcompiler_gnu.py b/numpy/distutils/tests/test_fcompiler_gnu.py index b7bba2f95..0817ae58c 100644 --- a/numpy/distutils/tests/test_fcompiler_gnu.py +++ b/numpy/distutils/tests/test_fcompiler_gnu.py @@ -28,7 +28,7 @@ gfortran_version_strings = [ ('GNU Fortran (crosstool-NG 8a21ab48) 7.2.0', '7.2.0') ] -class TestG77Versions(object): +class TestG77Versions: def test_g77_version(self): fc = numpy.distutils.fcompiler.new_fcompiler(compiler='gnu') for vs, version in g77_version_strings: @@ -41,7 +41,7 @@ class TestG77Versions(object): v = fc.version_match(vs) assert_(v is None, (vs, v)) -class TestGFortranVersions(object): +class TestGFortranVersions: def test_gfortran_version(self): fc = numpy.distutils.fcompiler.new_fcompiler(compiler='gnu95') for vs, version in gfortran_version_strings: diff --git a/numpy/distutils/tests/test_fcompiler_intel.py b/numpy/distutils/tests/test_fcompiler_intel.py index 3bb81e027..45c9cdac1 100644 --- a/numpy/distutils/tests/test_fcompiler_intel.py +++ b/numpy/distutils/tests/test_fcompiler_intel.py @@ -14,7 +14,7 @@ intel_64bit_version_strings = [ "running on Intel(R) 64, Version 11.1", '11.1') ] -class TestIntelFCompilerVersions(object): +class TestIntelFCompilerVersions: def test_32bit_version(self): fc = numpy.distutils.fcompiler.new_fcompiler(compiler='intel') for vs, version in intel_32bit_version_strings: @@ -22,7 +22,7 @@ class TestIntelFCompilerVersions(object): assert_(v == version) -class TestIntelEM64TFCompilerVersions(object): +class TestIntelEM64TFCompilerVersions: def test_64bit_version(self): fc = numpy.distutils.fcompiler.new_fcompiler(compiler='intelem') for vs, version in intel_64bit_version_strings: diff --git a/numpy/distutils/tests/test_fcompiler_nagfor.py b/numpy/distutils/tests/test_fcompiler_nagfor.py index 785aeda14..2e04f5266 100644 --- a/numpy/distutils/tests/test_fcompiler_nagfor.py +++ b/numpy/distutils/tests/test_fcompiler_nagfor.py @@ -14,7 +14,7 @@ nag_version_strings = [('nagfor', 'NAG Fortran Compiler Release ' '431,435,437,446,459-460,463,472,494,496,503,508,' '511,517,529,555,557,565)', '5.1')] -class TestNagFCompilerVersions(object): +class TestNagFCompilerVersions: def test_version_match(self): for comp, vs, version in nag_version_strings: fc = numpy.distutils.fcompiler.new_fcompiler(compiler=comp) diff --git a/numpy/distutils/tests/test_misc_util.py b/numpy/distutils/tests/test_misc_util.py index a584e0869..605c80483 100644 --- a/numpy/distutils/tests/test_misc_util.py +++ b/numpy/distutils/tests/test_misc_util.py @@ -9,7 +9,7 @@ from numpy.testing import ( ajoin = lambda *paths: join(*((sep,)+paths)) -class TestAppendpath(object): +class TestAppendpath: def test_1(self): assert_equal(appendpath('prefix', 'name'), join('prefix', 'name')) @@ -33,7 +33,7 @@ class TestAppendpath(object): assert_equal(appendpath('/prefix/sub/sub2', '/prefix/sub/sup/name'), ajoin('prefix', 'sub', 'sub2', 'sup', 'name')) -class TestMinrelpath(object): +class TestMinrelpath: def test_1(self): n = lambda path: path.replace('/', sep) @@ -47,7 +47,7 @@ class TestMinrelpath(object): assert_equal(minrelpath(n('.././..')), n('../..')) assert_equal(minrelpath(n('aa/bb/.././../dd')), n('dd')) -class TestGpaths(object): +class TestGpaths: def test_gpaths(self): local_path = minrelpath(join(dirname(__file__), '..')) @@ -56,7 +56,7 @@ class TestGpaths(object): f = gpaths('system_info.py', local_path) assert_(join(local_path, 'system_info.py') == f[0], repr(f)) -class TestSharedExtension(object): +class TestSharedExtension: def test_get_shared_lib_extension(self): import sys diff --git a/numpy/distutils/tests/test_npy_pkg_config.py b/numpy/distutils/tests/test_npy_pkg_config.py index d202fce85..b287ebe2e 100644 --- a/numpy/distutils/tests/test_npy_pkg_config.py +++ b/numpy/distutils/tests/test_npy_pkg_config.py @@ -34,7 +34,7 @@ libs = -L${libdir} simple_variable_d = {'cflags': '-I/foo/bar/include', 'libflags': '-L/foo/bar/lib', 'version': '0.1', 'name': 'foo'} -class TestLibraryInfo(object): +class TestLibraryInfo: def test_simple(self): with temppath('foo.ini') as path: with open(path, 'w') as f: @@ -61,7 +61,7 @@ class TestLibraryInfo(object): out.vars['prefix'] = '/Users/david' assert_(out.cflags() == '-I/Users/david/include') -class TestParseFlags(object): +class TestParseFlags: def test_simple_cflags(self): d = parse_flags("-I/usr/include") assert_(d['include_dirs'] == ['/usr/include']) diff --git a/numpy/distutils/tests/test_system_info.py b/numpy/distutils/tests/test_system_info.py index 04f5f8320..c40cdb7db 100644 --- a/numpy/distutils/tests/test_system_info.py +++ b/numpy/distutils/tests/test_system_info.py @@ -128,7 +128,7 @@ class DuplicateOptionInfo(_system_info): section = 'duplicate_options' -class TestSystemInfoReading(object): +class TestSystemInfoReading: def setup(self): """ Create the libraries """ |