Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 81aa94d

Browse files
committed
Fix some styling.
1 parent c2f5958 commit 81aa94d

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

‎tests/test_aspectlib_debug.py‎

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
except ImportError:
1616
from io import StringIO
1717

18-
1918
LOG_TEST_SIMPLE = r'''^some_meth\(1, 2, 3, a=4\) +<<< .*tests/test_aspectlib_debug.py:\d+:test_simple.*
20-
some_meth => \.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\. !"#\$%&\'\(\)\*\+,-\./0123456789:;<=>\?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\[\\\]\^_`abcdefghijklmnopqrstuvwxyz\{\|\}~\.+
19+
some_meth => \.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\. !"#\$%&\'\(\)\*\+,-\./0123456789:;<=>\?@''' \
20+
r'''ABCDEFGHIJKLMNOPQRSTUVWXYZ\[\\\]\^_`abcdefghijklmnopqrstuvwxyz\{\|\}~\.+
2121
$'''
2222

2323

@@ -86,9 +86,11 @@ def test_attributes():
8686
), methods='(?!bar)(?!__.*__$)'):
8787
MyStuff('bar').stuff()
8888
print(buf.getvalue())
89-
assert re.match(r"^\{test_aspectlib_debug.MyStuff foo='bar' bar='foo'\}.stuff\(\) +<<< .*tests/test_aspectlib_debug.py:\d+:test_attributes.*\n\{test_aspectlib_debug.MyStuff foo='bar' bar='foo'\}.stuff => bar\n$", buf.getvalue())
89+
assert re.match(r"^\{test_aspectlib_debug.MyStuff foo='bar' bar='foo'\}.stuff\(\) +<<< .*tests/test_aspectlib_debug.py:\d+:"
90+
r"test_attributes.*\n\{test_aspectlib_debug.MyStuff foo='bar' bar='foo'\}.stuff => bar\n$", buf.getvalue())
9091
MyStuff('bar').stuff()
91-
assert re.match(r"^\{test_aspectlib_debug.MyStuff foo='bar' bar='foo'\}.stuff\(\) +<<< .*tests/test_aspectlib_debug.py:\d+:test_attributes.*\n\{test_aspectlib_debug.MyStuff foo='bar' bar='foo'\}.stuff => bar\n$", buf.getvalue())
92+
assert re.match(r"^\{test_aspectlib_debug.MyStuff foo='bar' bar='foo'\}.stuff\(\) +<<< .*tests/test_aspectlib_debug.py:\d+:"
93+
r"test_attributes.*\n\{test_aspectlib_debug.MyStuff foo='bar' bar='foo'\}.stuff => bar\n$", buf.getvalue())
9294

9395

9496
def test_no_stack():
@@ -100,7 +102,8 @@ def test_no_stack():
100102
), methods='(?!bar)(?!__.*__$)'):
101103
MyStuff('bar').stuff()
102104
print(buf.getvalue())
103-
assert "{test_aspectlib_debug.MyStuff foo='bar' bar='foo'}.stuff()\n{test_aspectlib_debug.MyStuff foo='bar' bar='foo'}.stuff => bar\n" == buf.getvalue()
105+
assert "{test_aspectlib_debug.MyStuff foo='bar' bar='foo'}.stuff()\n" \
106+
"{test_aspectlib_debug.MyStuff foo='bar' bar='foo'}.stuff => bar\n" == buf.getvalue()
104107

105108

106109
def test_attributes_old_style():
@@ -112,9 +115,11 @@ def test_attributes_old_style():
112115
), methods='(?!bar)(?!__.*__$)'):
113116
OldStuff('bar').stuff()
114117
print(repr(buf.getvalue()))
115-
assert re.match(r"^\{test_aspectlib_debug.OldStuff foo='bar' bar='foo'\}.stuff\(\) +<<< .*tests/test_aspectlib_debug.py:\d+:test_attributes.*\n\{test_aspectlib_debug.OldStuff foo='bar' bar='foo'\}.stuff => bar\n$", buf.getvalue())
118+
assert re.match(r"^\{test_aspectlib_debug.OldStuff foo='bar' bar='foo'\}.stuff\(\) +<<< .*tests/test_aspectlib_debug.py:\d+:"
119+
r"test_attributes.*\n\{test_aspectlib_debug.OldStuff foo='bar' bar='foo'\}.stuff => bar\n$", buf.getvalue())
116120
MyStuff('bar').stuff()
117-
assert re.match(r"^\{test_aspectlib_debug.OldStuff foo='bar' bar='foo'\}.stuff\(\) +<<< .*tests/test_aspectlib_debug.py:\d+:test_attributes.*\n\{test_aspectlib_debug.OldStuff foo='bar' bar='foo'\}.stuff => bar\n$", buf.getvalue())
121+
assert re.match(r"^\{test_aspectlib_debug.OldStuff foo='bar' bar='foo'\}.stuff\(\) +<<< .*tests/test_aspectlib_debug.py:\d+:"
122+
r"test_attributes.*\n\{test_aspectlib_debug.OldStuff foo='bar' bar='foo'\}.stuff => bar\n$", buf.getvalue())
118123

119124

120125
def test_no_stack_old_style():
@@ -126,7 +131,8 @@ def test_no_stack_old_style():
126131
), methods='(?!bar)(?!__.*__$)'):
127132
OldStuff('bar').stuff()
128133
print(buf.getvalue())
129-
assert "{test_aspectlib_debug.OldStuff foo='bar' bar='foo'}.stuff()\n{test_aspectlib_debug.OldStuff foo='bar' bar='foo'}.stuff => bar\n" == buf.getvalue()
134+
assert "{test_aspectlib_debug.OldStuff foo='bar' bar='foo'}.stuff()\n" \
135+
"{test_aspectlib_debug.OldStuff foo='bar' bar='foo'}.stuff => bar\n" == buf.getvalue()
130136

131137

132138
@pytest.mark.skipif(sys.version_info < (2, 7), reason="No weakref.WeakSet on Python<=2.6")

‎tests/test_integrations.py‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
from aspectlib.test import record
1515
from aspectlib.utils import PYPY
1616

17-
try:
18-
import thread
19-
except ImportError:
20-
import _thread as thread
21-
2217
try:
2318
from StringIO import StringIO
2419
except ImportError:
@@ -62,6 +57,7 @@ def test_fork():
6257
os._exit(0)
6358
assert pid != 'foobar'
6459

60+
6561
def test_socket(target=socket.socket):
6662
buf = StringIO()
6763
with aspectlib.weave(target, aspectlib.debug.log(
@@ -116,7 +112,7 @@ def test_socket_all_methods():
116112
lazy=True,
117113
methods=aspectlib.ALL_METHODS
118114
):
119-
s=socket.socket()
115+
socket.socket()
120116

121117
assert "}.__init__ => None" in buf.getvalue()
122118

‎tests/test_pkg1/test_pkg2/test_mod.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ def func(*a):
99
def raises(*a):
1010
raise ValueError(a)
1111

12+
1213
a = 1
1314

1415

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /