aboutsummaryrefslogtreecommitdiff
path: root/tests/cmdline
diff options
context:
space:
mode:
authorDavid Lechner2020-03-22 21:26:08 -0500
committerDamien George2020-03-30 13:21:58 +1100
commit3dc324d3f1312e40d3a8ed87e7244966bb756f26 (patch)
tree94ff44f8eabba0039582c245b901173597edd11e /tests/cmdline
parent488613bca6c460340ed2995ae5cafafe22d0bfff (diff)
tests: Format all Python code with black, except tests in basics subdir.
This adds the Python files in the tests/ directory to be formatted with ./tools/codeformat.py. The basics/ subdirectory is excluded for now so we aren't changing too much at once. In a few places `# fmt: off`/`# fmt: on` was used where the code had special formatting for readability or where the test was actually testing the specific formatting.
Diffstat (limited to 'tests/cmdline')
-rw-r--r--tests/cmdline/cmd_parsetree.py8
-rw-r--r--tests/cmdline/cmd_showbc.py1
-rw-r--r--tests/cmdline/cmd_showbc.py.exp26
3 files changed, 18 insertions, 17 deletions
diff --git a/tests/cmdline/cmd_parsetree.py b/tests/cmdline/cmd_parsetree.py
index da36c8070..50da36954 100644
--- a/tests/cmdline/cmd_parsetree.py
+++ b/tests/cmdline/cmd_parsetree.py
@@ -4,9 +4,9 @@
for i in ():
pass
a = None
-b = 'str'
-c = 'a very long str that will not be interned'
-d = b'bytes'
-e = b'a very long bytes that will not be interned'
+b = "str"
+c = "a very long str that will not be interned"
+d = b"bytes"
+e = b"a very long bytes that will not be interned"
f = 123456789012345678901234567890
g = 123
diff --git a/tests/cmdline/cmd_showbc.py b/tests/cmdline/cmd_showbc.py
index f30b39ee1..a960c15c4 100644
--- a/tests/cmdline/cmd_showbc.py
+++ b/tests/cmdline/cmd_showbc.py
@@ -1,5 +1,6 @@
# cmdline: -v -v
# test printing of all bytecodes
+# fmt: off
def f():
# constants
diff --git a/tests/cmdline/cmd_showbc.py.exp b/tests/cmdline/cmd_showbc.py.exp
index 4d90ae22c..325efc7db 100644
--- a/tests/cmdline/cmd_showbc.py.exp
+++ b/tests/cmdline/cmd_showbc.py.exp
@@ -7,7 +7,7 @@ arg names:
(N_EXC_STACK 0)
bc=0 line=1
########
- bc=\\d\+ line=159
+ bc=\\d\+ line=160
00 MAKE_FUNCTION \.\+
\\d\+ STORE_NAME f
\\d\+ MAKE_FUNCTION \.\+
@@ -45,7 +45,7 @@ Raw bytecode (code_info_size=\\d\+, bytecode_size=\\d\+):
(INIT_CELL 16)
bc=0 line=1
########
- bc=\\d\+ line=126
+ bc=\\d\+ line=127
00 LOAD_CONST_NONE
01 LOAD_CONST_FALSE
02 BINARY_OP 27 __add__
@@ -320,7 +320,7 @@ Raw bytecode (code_info_size=\\d\+, bytecode_size=\\d\+):
(N_EXC_STACK 0)
bc=0 line=1
########
- bc=\\d\+ line=132
+ bc=\\d\+ line=133
00 LOAD_CONST_SMALL_INT 1
01 DUP_TOP
02 STORE_FAST 0
@@ -376,7 +376,7 @@ arg names: a
(N_EXC_STACK 0)
(INIT_CELL 0)
########
- bc=\\d\+ line=138
+ bc=\\d\+ line=139
00 LOAD_CONST_SMALL_INT 2
01 BUILD_TUPLE 1
03 LOAD_NULL
@@ -393,9 +393,9 @@ arg names:
(N_STATE 2)
(N_EXC_STACK 0)
bc=0 line=1
- bc=0 line=143
- bc=3 line=144
- bc=6 line=145
+ bc=0 line=144
+ bc=3 line=145
+ bc=6 line=146
00 LOAD_CONST_NONE
01 YIELD_VALUE
02 POP_TOP
@@ -418,7 +418,7 @@ arg names:
(N_EXC_STACK 0)
bc=0 line=1
########
- bc=13 line=149
+ bc=13 line=150
00 LOAD_NAME __name__ (cache=0)
04 STORE_NAME __module__
07 LOAD_CONST_STRING 'Class'
@@ -433,7 +433,7 @@ arg names: self
(N_STATE 4)
(N_EXC_STACK 0)
bc=0 line=1
- bc=0 line=156
+ bc=0 line=157
00 LOAD_GLOBAL super (cache=0)
\\d\+ LOAD_GLOBAL __class__ (cache=0)
\\d\+ LOAD_FAST 0
@@ -450,7 +450,7 @@ arg names: * * *
(N_STATE 9)
(N_EXC_STACK 0)
bc=0 line=1
- bc=0 line=59
+ bc=0 line=60
########
00 LOAD_NULL
01 LOAD_FAST 2
@@ -474,7 +474,7 @@ arg names: * * *
(N_STATE 10)
(N_EXC_STACK 0)
bc=0 line=1
- bc=0 line=60
+ bc=0 line=61
########
00 BUILD_LIST 0
02 LOAD_FAST 2
@@ -517,7 +517,7 @@ arg names: *
(N_EXC_STACK 0)
bc=0 line=1
########
- bc=\\d\+ line=113
+ bc=\\d\+ line=114
00 LOAD_DEREF 0
02 LOAD_CONST_SMALL_INT 1
03 BINARY_OP 27 __add__
@@ -536,7 +536,7 @@ arg names: * b
(N_EXC_STACK 0)
bc=0 line=1
########
- bc=\\d\+ line=139
+ bc=\\d\+ line=140
00 LOAD_FAST 1
01 LOAD_DEREF 0
03 BINARY_OP 27 __add__