Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Commit 4da947c

Browse files
committed
Fixed compatability issues: set literals don't exist in py26 and __builtin__ doesn't exist in py3.
1 parent a6a366c commit 4da947c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

test_pep257.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ def test_ignore_list():
2121
no blank line after one-liner is bad. Also this - \"\"\"
2222
return foo
2323
"""
24-
expected_error_codes = {'D100', 'D400', 'D401', 'D205', 'D209'}
24+
expected_error_codes = set(('D100', 'D400', 'D401', 'D205', 'D209'))
2525
mock_open = mock.mock_open(read_data=function_to_check)
26-
with mock.patch('__builtin__.open', mock_open, create=True):
26+
with mock.patch('pep257.open', mock_open, create=True):
2727
errors = tuple(pep257.check(['filepath']))
2828
error_codes = set(error.code for error in errors)
2929
assert error_codes == expected_error_codes
3030

3131
errors = tuple(pep257.check(['filepath'], ignore=['D100', 'D202']))
3232
error_codes = set(error.code for error in errors)
33-
assert error_codes == expected_error_codes - {'D100', 'D202'}
33+
assert error_codes == expected_error_codes - set(('D100', 'D202'))

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
envlist = py26, py27, py32, py33, py34, pypy, pypy3
88

99
[testenv]
10-
commands = py.test --pep8
10+
commands = py.test --pep8 --clearcache
1111
deps = pytest
1212
pytest-pep8
1313
mock

0 commit comments

Comments
 (0)