Skip to content

Commit b93fe9e

Browse files
committed
tests/cmdline: Make tests succeed irregardless of invocation path.
Signed-off-by: stijn <stijn@ignitron.net>
1 parent 4420163 commit b93fe9e

File tree

8 files changed

+24
-25
lines changed

8 files changed

+24
-25
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__file__ = cmdline/cmd_file_variable.py
1+
__file__ = \.\*cmdline/cmd_file_variable.py
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
['cmdline.cmd_module_atexit', 'cmdline/cmd_module_atexit.py']
1+
['cmdline.cmd_module_atexit', '\.\*cmdline/cmd_module_atexit.py']
22
start
33
done
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
['cmdline.cmd_module_atexit_exc', 'cmdline/cmd_module_atexit_exc.py']
1+
['cmdline.cmd_module_atexit_exc', '\.\*cmdline/cmd_module_atexit_exc.py']
22
start
33
done

tests/cmdline/cmd_showbc.py.exp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
File cmdline/cmd_showbc.py, code block '<module>' (descriptor: \.\+, bytecode @\.\+ 63 bytes)
1+
File \.\*cmdline/cmd_showbc.py, code block '<module>' (descriptor: \.\+, bytecode @\.\+ 63 bytes)
22
Raw bytecode (code_info_size=18, bytecode_size=45):
33
10 20 01 60 20 84 7d 64 60 88 07 64 60 69 20 62
44
64 20 32 00 16 05 32 01 16 05 81 2a 01 53 33 02
@@ -47,7 +47,7 @@ arg names:
4747
42 IMPORT_STAR
4848
43 LOAD_CONST_NONE
4949
44 RETURN_VALUE
50-
File cmdline/cmd_showbc.py, code block 'f' (descriptor: \.\+, bytecode @\.\+ 46\[68\] bytes)
50+
File \.\*cmdline/cmd_showbc.py, code block 'f' (descriptor: \.\+, bytecode @\.\+ 46\[68\] bytes)
5151
Raw bytecode (code_info_size=8\[46\], bytecode_size=382):
5252
a8 12 9\[bf\] 03 05 60 60 26 22 24 64 22 24 25 25 24
5353
26 23 63 22 22 25 23 23 2f 6c 25 65 25 25 69 68
@@ -411,7 +411,7 @@ arg names:
411411
379 RETURN_VALUE
412412
380 LOAD_CONST_NONE
413413
381 RETURN_VALUE
414-
File cmdline/cmd_showbc.py, code block 'f' (descriptor: \.\+, bytecode @\.\+ 59 bytes)
414+
File \.\*cmdline/cmd_showbc.py, code block 'f' (descriptor: \.\+, bytecode @\.\+ 59 bytes)
415415
Raw bytecode (code_info_size=8, bytecode_size=51):
416416
a8 10 0a 05 80 82 34 38 81 57 c0 57 c1 57 c2 57
417417
c3 57 c4 57 c5 57 c6 57 c7 57 c8 c9 82 57 ca 57
@@ -470,7 +470,7 @@ arg names:
470470
48 POP_TOP
471471
49 LOAD_CONST_NONE
472472
50 RETURN_VALUE
473-
File cmdline/cmd_showbc.py, code block 'f' (descriptor: \.\+, bytecode @\.\+ 20 bytes)
473+
File \.\*cmdline/cmd_showbc.py, code block 'f' (descriptor: \.\+, bytecode @\.\+ 20 bytes)
474474
Raw bytecode (code_info_size=9, bytecode_size=11):
475475
a1 01 0b 05 06 80 88 40 00 82 2a 01 53 b0 21 00
476476
01 c1 51 63
@@ -489,7 +489,7 @@ arg names: a
489489
08 STORE_FAST 1
490490
09 LOAD_CONST_NONE
491491
10 RETURN_VALUE
492-
File cmdline/cmd_showbc.py, code block 'f' (descriptor: \.\+, bytecode @\.\+ 21 bytes)
492+
File \.\*cmdline/cmd_showbc.py, code block 'f' (descriptor: \.\+, bytecode @\.\+ 21 bytes)
493493
Raw bytecode (code_info_size=8, bytecode_size=13):
494494
88 40 0a 05 80 8f 23 23 51 67 59 81 67 59 81 5e
495495
51 68 59 51 63
@@ -513,7 +513,7 @@ arg names:
513513
10 POP_TOP
514514
11 LOAD_CONST_NONE
515515
12 RETURN_VALUE
516-
File cmdline/cmd_showbc.py, code block 'Class' (descriptor: \.\+, bytecode @\.\+ 1\[56\] bytes)
516+
File \.\*cmdline/cmd_showbc.py, code block 'Class' (descriptor: \.\+, bytecode @\.\+ 1\[56\] bytes)
517517
Raw bytecode (code_info_size=\[56\], bytecode_size=10):
518518
00 \.\+ 11 0f 16 10 10 02 16 11 51 63
519519
arg names:
@@ -528,7 +528,7 @@ arg names:
528528
06 STORE_NAME __qualname__
529529
08 LOAD_CONST_NONE
530530
09 RETURN_VALUE
531-
File cmdline/cmd_showbc.py, code block 'f' (descriptor: \.\+, bytecode @\.\+ 18 bytes)
531+
File \.\*cmdline/cmd_showbc.py, code block 'f' (descriptor: \.\+, bytecode @\.\+ 18 bytes)
532532
Raw bytecode (code_info_size=6, bytecode_size=12):
533533
19 08 05 12 80 9c 12 13 12 14 b0 15 05 36 00 59
534534
51 63
@@ -545,7 +545,7 @@ arg names: self
545545
09 POP_TOP
546546
10 LOAD_CONST_NONE
547547
11 RETURN_VALUE
548-
File cmdline/cmd_showbc.py, code block '<genexpr>' (descriptor: \.\+, bytecode @\.\+ 28 bytes)
548+
File \.\*cmdline/cmd_showbc.py, code block '<genexpr>' (descriptor: \.\+, bytecode @\.\+ 28 bytes)
549549
Raw bytecode (code_info_size=9, bytecode_size=19):
550550
c3 40 0c 09 03 03 03 80 3b 53 b2 53 53 4b 0b c3
551551
25 01 44 39 25 00 67 59 42 33 51 63
@@ -568,7 +568,7 @@ arg names: * * *
568568
15 JUMP 4
569569
17 LOAD_CONST_NONE
570570
18 RETURN_VALUE
571-
File cmdline/cmd_showbc.py, code block '<listcomp>' (descriptor: \.\+, bytecode @\.\+ 26 bytes)
571+
File \.\*cmdline/cmd_showbc.py, code block '<listcomp>' (descriptor: \.\+, bytecode @\.\+ 26 bytes)
572572
Raw bytecode (code_info_size=8, bytecode_size=18):
573573
4b 0c 0a 03 03 03 80 3c 2b 00 b2 5f 4b 0b c3 25
574574
01 44 39 25 00 2f 14 42 33 63
@@ -588,7 +588,7 @@ arg names: * * *
588588
13 STORE_COMP 20
589589
15 JUMP 4
590590
17 RETURN_VALUE
591-
File cmdline/cmd_showbc.py, code block '<dictcomp>' (descriptor: \.\+, bytecode @\.\+ 28 bytes)
591+
File \.\*cmdline/cmd_showbc.py, code block '<dictcomp>' (descriptor: \.\+, bytecode @\.\+ 28 bytes)
592592
Raw bytecode (code_info_size=8, bytecode_size=20):
593593
53 0c 0b 03 03 03 80 3d 2c 00 b2 5f 4b 0d c3 25
594594
01 44 39 25 00 25 00 2f 19 42 31 63
@@ -609,7 +609,7 @@ arg names: * * *
609609
15 STORE_COMP 25
610610
17 JUMP 4
611611
19 RETURN_VALUE
612-
File cmdline/cmd_showbc.py, code block 'closure' (descriptor: \.\+, bytecode @\.\+ 20 bytes)
612+
File \.\*cmdline/cmd_showbc.py, code block 'closure' (descriptor: \.\+, bytecode @\.\+ 20 bytes)
613613
Raw bytecode (code_info_size=8, bytecode_size=12):
614614
19 0c 0c 03 80 6f 25 23 25 00 81 f2 c1 81 27 00
615615
29 00 51 63
@@ -629,7 +629,7 @@ arg names: *
629629
08 DELETE_DEREF 0
630630
10 LOAD_CONST_NONE
631631
11 RETURN_VALUE
632-
File cmdline/cmd_showbc.py, code block 'f' (descriptor: \.\+, bytecode @\.\+ 13 bytes)
632+
File \.\*cmdline/cmd_showbc.py, code block 'f' (descriptor: \.\+, bytecode @\.\+ 13 bytes)
633633
Raw bytecode (code_info_size=8, bytecode_size=5):
634634
9a 01 0a 05 03 08 80 8b b1 25 00 f2 63
635635
arg names: * b

tests/cmdline/cmd_showbc_const.py.exp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
File cmdline/cmd_showbc_const.py, code block '<module>' (descriptor: \.\+, bytecode @\.\+ 198 bytes)
1+
File \.\*cmdline/cmd_showbc_const.py, code block '<module>' (descriptor: \.\+, bytecode @\.\+ 198 bytes)
22
Raw bytecode (code_info_size=40, bytecode_size=158):
33
2c 4c 01 60 2c 46 22 65 27 4a 83 0c 20 27 40 20
44
27 20 27 40 60 20 27 24 40 60 40 24 27 47 24 27

tests/cmdline/cmd_showbc_opt.py.exp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
File cmdline/cmd_showbc_opt.py, code block '<module>' (descriptor: \.\+, bytecode @\.\+ 35 bytes)
1+
File \.\*cmdline/cmd_showbc_opt.py, code block '<module>' (descriptor: \.\+, bytecode @\.\+ 35 bytes)
22
Raw bytecode (code_info_size=13, bytecode_size=22):
33
00 16 01 60 20 64 40 84 07 64 40 84 07 32 00 16
44
02 32 01 16 03 32 02 16 04 32 03 16 05 32 04 16
@@ -27,7 +27,7 @@ arg names:
2727
18 STORE_NAME f4
2828
20 LOAD_CONST_NONE
2929
21 RETURN_VALUE
30-
File cmdline/cmd_showbc_opt.py, code block 'f0' (descriptor: \.\+, bytecode @\.\+ 8 bytes)
30+
File \.\*cmdline/cmd_showbc_opt.py, code block 'f0' (descriptor: \.\+, bytecode @\.\+ 8 bytes)
3131
Raw bytecode (code_info_size=6, bytecode_size=2):
3232
08 08 02 60 40 22 80 63
3333
arg names:
@@ -39,7 +39,7 @@ arg names:
3939
bc=2 line=7
4040
00 LOAD_CONST_SMALL_INT 0
4141
01 RETURN_VALUE
42-
File cmdline/cmd_showbc_opt.py, code block 'f1' (descriptor: \.\+, bytecode @\.\+ 22 bytes)
42+
File \.\*cmdline/cmd_showbc_opt.py, code block 'f1' (descriptor: \.\+, bytecode @\.\+ 22 bytes)
4343
Raw bytecode (code_info_size=9, bytecode_size=13):
4444
11 0e 03 08 80 0a 23 22 20 b0 44 42 51 63 12 07
4545
82 34 01 59 51 63
@@ -61,7 +61,7 @@ arg names: x
6161
10 POP_TOP
6262
11 LOAD_CONST_NONE
6363
12 RETURN_VALUE
64-
File cmdline/cmd_showbc_opt.py, code block 'f2' (descriptor: \.\+, bytecode @\.\+ 10 bytes)
64+
File \.\*cmdline/cmd_showbc_opt.py, code block 'f2' (descriptor: \.\+, bytecode @\.\+ 10 bytes)
6565
Raw bytecode (code_info_size=7, bytecode_size=3):
6666
11 0a 04 08 80 11 23 12 09 65
6767
arg names: x
@@ -72,7 +72,7 @@ arg names: x
7272
bc=3 line=19
7373
00 LOAD_GLOBAL Exception
7474
02 RAISE_OBJ
75-
File cmdline/cmd_showbc_opt.py, code block 'f3' (descriptor: \.\+, bytecode @\.\+ 24 bytes)
75+
File \.\*cmdline/cmd_showbc_opt.py, code block 'f3' (descriptor: \.\+, bytecode @\.\+ 24 bytes)
7676
Raw bytecode (code_info_size=9, bytecode_size=15):
7777
11 0e 05 08 80 16 22 22 23 42 42 42 43 b0 43 3b
7878
12 07 82 34 01 59 51 63
@@ -94,7 +94,7 @@ arg names: x
9494
12 POP_TOP
9595
13 LOAD_CONST_NONE
9696
14 RETURN_VALUE
97-
File cmdline/cmd_showbc_opt.py, code block 'f4' (descriptor: \.\+, bytecode @\.\+ 24 bytes)
97+
File \.\*cmdline/cmd_showbc_opt.py, code block 'f4' (descriptor: \.\+, bytecode @\.\+ 24 bytes)
9898
Raw bytecode (code_info_size=9, bytecode_size=15):
9999
11 0e 06 08 80 1d 22 22 23 42 42 42 40 b0 43 3b
100100
12 07 82 34 01 59 51 63

tests/cmdline/cmd_verbose.py.exp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
File cmdline/cmd_verbose.py, code block '<module>' (descriptor: \.\+, bytecode @\.\+ 12 bytes)
1+
File \.\*cmdline/cmd_verbose.py, code block '<module>' (descriptor: \.\+, bytecode @\.\+ 12 bytes)
22
Raw bytecode (code_info_size=4, bytecode_size=8):
33
08 04 01 40 11 02 81 34 01 59 51 63
44
arg names:

tests/run-tests.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,6 +1223,7 @@ def main():
12231223
test_extensions += ("*.js", "*.mjs")
12241224

12251225
all_test_dirs = []
1226+
main_tests_dir_in_args = None
12261227
if args.test_dirs is not None:
12271228
# Run tests from given directories though if user explicitly passes this directory as argument
12281229
# still do the normal test discovery to be consistent with running from within this directory.
@@ -1232,8 +1233,6 @@ def main():
12321233
main_tests_dir_in_args = test_dir
12331234
else:
12341235
all_test_dirs.append(test_dir)
1235-
else:
1236-
main_tests_dir_in_args = None
12371236

12381237
if args.test_dirs is None or main_tests_dir_in_args is not None:
12391238
test_dirs = (

0 commit comments

Comments
 (0)