-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
710 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
if True: | ||
from unittest import mock as foo | ||
from unittest import mock as bar | ||
from unittest import mock | ||
import os | ||
from unittest import mock as foo | ||
from unittest import mock as bar | ||
from unittest import mock | ||
|
||
if True: | ||
from unittest import mock as foo | ||
from unittest import mock as bar | ||
from unittest import mock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# These should be changed | ||
if True: | ||
import mock | ||
|
||
if True: | ||
import mock, sys | ||
|
||
# This goes to from unitest import mock | ||
import mock.mock | ||
|
||
# Mock should go on a new line as `from unittest import mock` | ||
import contextlib, mock, sys | ||
|
||
# Mock should go on a new line as `from unittest import mock` | ||
import mock, sys | ||
x = "This code should be preserved one line below the mock" | ||
|
||
# Mock should go on a new line as `from unittest import mock` | ||
from mock import mock | ||
|
||
# Should keep trailing comma | ||
from mock import ( | ||
mock, | ||
a, | ||
b, | ||
c, | ||
) | ||
|
||
# Should not get a trailing comma | ||
from mock import ( | ||
mock, | ||
a, | ||
b, | ||
c | ||
) | ||
|
||
if True: | ||
if False: | ||
from mock import ( | ||
mock, | ||
a, | ||
b, | ||
c | ||
) | ||
|
||
# These should not change: | ||
import os, io | ||
|
||
# Mock should go on a new line as `from unittest import mock` | ||
import mock, mock | ||
|
||
# Mock should go on a new line as `from unittest import mock as foo` | ||
import mock as foo | ||
|
||
# Mock should go on a new line as `from unittest import mock as foo` | ||
from mock import mock as foo | ||
|
||
if True: | ||
# This should yield multiple, aliased imports. | ||
import mock as foo, mock as bar, mock | ||
|
||
# This should yield multiple, aliased imports, and preserve `os`. | ||
import mock as foo, mock as bar, mock, os | ||
|
||
if True: | ||
# This should yield multiple, aliased imports. | ||
from mock import mock as foo, mock as bar, mock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -911,6 +911,7 @@ | |
"UP023", | ||
"UP024", | ||
"UP025", | ||
"UP026", | ||
"W", | ||
"W2", | ||
"W29", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.