Permalink
Browse files

Removed Python 2.6 support (#327)

Closes #293
  • Loading branch information...
mrbean-bremen authored and jmcgeheeiv committed Nov 13, 2017
1 parent 46197ea commit 764260b71e4766d5ba41a369cd9b6f6e407e1ad9
View
@@ -18,8 +18,6 @@ language: python
matrix:
include:
- python: 2.6
env: PYTHON=py26
- python: 2.7
env: PYTHON=py27
- python: 3.3
View
@@ -13,10 +13,6 @@ if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
eval "$(pyenv init -)"
case "${PYTHON}" in
py26)
pyenv install 2.6.6
pyenv global 2.6.6
;;
py27)
curl -O https://bootstrap.pypa.io/get-pip.py
python get-pip.py --user
View
@@ -9,6 +9,7 @@ must use pyfakefs 3.3 or earlier.
#### New Features
#### Infrastructure
* Removed Python 2.6 support [#293](../../issues/293)
#### Fixes
View
@@ -14,10 +14,7 @@
Tests for patching modules loaded after `setupPyfakefs()`.
"""
import sys
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
import unittest
from pyfakefs import fake_filesystem_unittest
View
@@ -30,13 +30,10 @@
import io
import os
import sys
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
import unittest
from pyfakefs import fake_filesystem_unittest
# The module under test is pyfakefs/example
import example
@@ -16,15 +16,9 @@
"""Test for glob using fake_filesystem."""
import doctest
import glob
import os
import sys
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
import unittest
from pyfakefs import fake_filesystem_unittest
@@ -22,17 +22,11 @@
import os
import shutil
import sys
import time
import unittest
from fake_filesystem_test import RealFsTestMixin
from pyfakefs import fake_filesystem_unittest
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
class RealFsTestCase(fake_filesystem_unittest.TestCase, RealFsTestMixin):
def __init__(self, methodName='runTest'):
View
@@ -19,23 +19,17 @@
import errno
import io
import locale
import platform
import os
import platform
import shutil
import stat
import sys
import tempfile
import time
import shutil
from pyfakefs.fake_filesystem import FakeFileOpen
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
import unittest
from pyfakefs import fake_filesystem
from pyfakefs.fake_filesystem import FakeFileOpen
class _DummyTime(object):
@@ -5165,12 +5159,7 @@ def testRelpath(self):
path_other = '!some!where!else'
self.assertRaises(ValueError, self.path.relpath, None)
self.assertRaises(ValueError, self.path.relpath, '')
if sys.version_info < (2, 7):
# The real Python 2.6 os.path.relpath('!path!to!foo') actually does
# return '..!path!to!foo' instead of 'path!to!foo'
self.assertEqual('..!path!to!foo', self.path.relpath(path_foo))
else:
self.assertEqual('path!to!foo', self.path.relpath(path_foo))
self.assertEqual('path!to!foo', self.path.relpath(path_foo))
self.assertEqual('..!foo',
self.path.relpath(path_foo, path_bar))
self.assertEqual('..!..!..%s' % path_other,
@@ -6219,8 +6208,6 @@ def testTellFlushesInPython3(self):
expected = 0 if sys.version_info < (3,) else 4
self.assertEqual(expected, self.os.path.getsize(file_path))
@unittest.skipIf(sys.version_info < (2, 7),
'Python 2.6 behaves differently')
def testReadFlushesUnderPosix(self):
# Regression test for #278
self.checkPosixOnly()
@@ -6432,8 +6419,6 @@ def testOpenWithWplus(self):
def testOpenWithAppendFlag(self):
# FIXME: under Windows, line endings are not handled correctly
self.skipRealFsFailure(skipPosix=False)
if self.useRealFs() and sys.version_info < (2, 7):
raise unittest.SkipTest('Python 2.6 behaving differently here')
contents = [
u'Калинка,\n',
u'калинка,\n',
@@ -24,6 +24,7 @@
import glob
import shutil
import sys
import unittest
from unittest import TestCase
from import_as_example import check_if_exists
@@ -33,11 +34,6 @@
if sys.version_info >= (3, 4):
import pathlib
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
class TestPatcher(TestCase):
def testContextManager(self):
@@ -204,16 +200,18 @@ def test_own_path_module(self):
self.assertEqual(2, path.floor(2.5))
@unittest.skipIf(sys.version_info < (2, 7), "No byte strings in Python 2.6")
class TestCopyOrAddRealFile(TestPyfakefsUnittestBase):
"""Tests the `fake_filesystem_unittest.TestCase.copyRealFile()` method.
Note that `copyRealFile()` is deprecated in favor of `FakeFilesystem.add_real_file()`.
Note that `copyRealFile()` is deprecated in favor of
`FakeFilesystem.add_real_file()`.
"""
with open(__file__) as f:
real_string_contents = f.read()
with open(__file__, 'rb') as f:
real_byte_contents = f.read()
real_stat = os.stat(__file__)
@classmethod
def setUpClass(cls):
with open(__file__) as f:
cls.real_string_contents = f.read()
with open(__file__, 'rb') as f:
cls.real_byte_contents = f.read()
cls.real_stat = os.stat(__file__)
@unittest.skipIf(sys.platform == 'darwin', 'Different copy behavior')
def testCopyRealFile(self):
@@ -18,17 +18,12 @@
# pylint: disable-all
import os # @UnusedImport
import os.path
import os
import shutil
import sys
import tempfile
import time
import sys
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
import unittest
from pyfakefs import fake_filesystem
View
@@ -21,13 +21,8 @@
import os
import stat
import sys
import tempfile
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
import unittest
from pyfakefs import fake_filesystem_unittest
View
@@ -15,15 +15,9 @@
import datetime
import math
import os
import unittest
from os import path
import sys
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
import mox3_stubout_example
from pyfakefs import mox3_stubout
@@ -66,10 +66,7 @@
if sys.version_info >= (3, 4):
from pyfakefs import fake_pathlib
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
import unittest
if sys.version_info < (3,):
import __builtin__ as builtins # pylint: disable=import-error
@@ -260,8 +257,6 @@ class Patcher(object):
HAS_PATHLIB = sys.version_info >= (3, 4)
IS_WINDOWS = sys.platform in ('win32', 'cygwin')
# To add py.test support per issue https://github.com/jmcgeheeiv/pyfakefs/issues/43,
# it appears that adding 'py', 'pytest', '_pytest' to SKIPNAMES will help
SKIPNAMES = set(['os', 'path', 'io', 'genericpath'])
if HAS_PATHLIB:
SKIPNAMES.add('pathlib')
@@ -380,7 +375,7 @@ def _patch_tempfile(self):
Shall be replaced by a more generic mechanism.
"""
if 'unlink' in tempfile._TemporaryFileWrapper.__dict__:
# Python 2.6 to 3.2: unlink is a class method of _TemporaryFileWrapper
# Python 2.7 to 3.2: unlink is a class method of _TemporaryFileWrapper
tempfile._TemporaryFileWrapper.unlink = self.fake_os.unlink
# Python 3.0 to 3.2 (and PyPy3 based on Python 3.2):
View
@@ -1,3 +1 @@
unittest2; python_version < '2.7'
importlib; python_version < '2.7'
pytest>=2.8.6
View
@@ -2,7 +2,7 @@
# Copyright 2009 Google Inc. All Rights Reserved.
# Copyright 2014 Altera Corporation. All Rights Reserved.
# Copyright 2014-2015 John McGehee
# Copyright 2014-2017 John McGehee
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -19,8 +19,6 @@
from pyfakefs.fake_filesystem import __version__
import os
NAME = 'pyfakefs'
REQUIRES = []
DESCRIPTION = 'pyfakefs implements a fake file system that mocks the Python file system modules.'
@@ -41,7 +39,6 @@
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
@@ -91,8 +88,5 @@
from setuptools import setup
except ImportError:
from distutils.core import setup
else:
params['tests_require'] = ['unittest2']
params['test_suite'] = 'unittest2.collector'
setup(**params) # pylint: disable = W0142
View
@@ -1,5 +1,5 @@
[tox]
envlist=py26,py27,py33,py34,py35,py36,py37,pypy
envlist=py27,py33,py34,py35,py36,py37,pypy
[testenv]
deps = -rrequirements.txt

0 comments on commit 764260b

Please sign in to comment.