-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drop python<=3.7 support #170
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import codecs | ||
import locale | ||
import os | ||
import posixpath | ||
|
@@ -18,27 +17,7 @@ | |
from xml.etree import ElementTree as ET | ||
|
||
|
||
if sys.version_info >= (3, 8): | ||
from unittest import mock | ||
else: | ||
# unittest.mock in 3.7 is too old to support | ||
# all the features used in the test suite | ||
import mock | ||
|
||
from check_manifest import rmtree | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This import is necessary and removing it breaks the test suite (which you can only see on Appveyor because GitHub Actions cancels all the useful test runs early after seeing the isort failure). |
||
|
||
CAN_SKIP_TESTS = os.getenv('SKIP_NO_TESTS', '') == '' | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How do things not break if you remove this line? Something is wrong. |
||
|
||
try: | ||
codecs.lookup('oem') | ||
except LookupError: | ||
HAS_OEM_CODEC = False | ||
else: | ||
# Python >= 3.6 on Windows | ||
HAS_OEM_CODEC = True | ||
|
||
from unittest import mock | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This import needs to be moved above the Also, I need to review my isort command-line because a complaint of the sort
is useless when it won't tell me which imports where and how to sort them. It could show a diff or something. |
||
class MockUI: | ||
|
||
|
@@ -115,7 +94,7 @@ def test_run_no_such_program(self): | |
should_start_with = "could not run ['there-is-really-no-such-program']:" | ||
self.assertTrue( | ||
str(cm.exception).startswith(should_start_with), | ||
'\n%r does not start with\n%r' % (str(cm.exception), | ||
'\n{!r} does not start with\n{!r}'.format(str(cm.exception), | ||
should_start_with)) | ||
|
||
Comment on lines
95
to
98
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line is now misindented: it was matching the position of the If we used an f-string here, maybe it would fit without wrapping? |
||
def test_mkdtemp_readonly_files(self): | ||
|
@@ -179,7 +158,7 @@ def test_copy_files(self): | |
'cp a %s' % n('/dest/dir/a'), | ||
'mkdir %s' % n('/dest/dir/b'), | ||
'makedirs %s' % n('/dest/dir/c/d'), | ||
'cp %s %s' % (n('c/d/e'), n('/dest/dir/c/d/e')), | ||
'cp {} {}'.format(n('c/d/e'), n('/dest/dir/c/d/e')), | ||
]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, why change this line but leave all of the previous lines using %-formatting? This offends my sense of consistency. |
||
|
||
def test_get_one_file_in(self): | ||
|
@@ -1165,8 +1144,6 @@ class TestBzr(VCSMixin, unittest.TestCase): | |
vcs = BzrHelper() | ||
|
||
|
||
@unittest.skipIf(HAS_OEM_CODEC, | ||
"Python 3.6 lets us use 'oem' codec instead of guessing") | ||
class TestBzrTerminalCharsetDetectionOnOldPythons(unittest.TestCase): | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think these two test classes could possibly work at the same time. This one is meant for Python < 3.6 and should be removed entirely. |
||
@mock.patch('sys.stdin') | ||
|
@@ -1198,8 +1175,6 @@ def test_terminal_encoding_cp0(self, mock_stdout): | |
self.assertEqual(Bazaar._get_terminal_encoding(), None) | ||
|
||
|
||
@unittest.skipIf(not HAS_OEM_CODEC, | ||
"'oem' codec not available on Python before 3.6") | ||
class TestBzrTerminalCharsetDetectionOnNewPythons(unittest.TestCase): | ||
|
||
def test_terminal_encoding_cp0(self): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add some newer PyPy version instead. I don't want to claim PyPy compatibility if I don't run tests on PyPy in CI.