Skip to content

Commit 07d321a

Browse files
committed
vm: tidy tests
1 parent 7c07fd2 commit 07d321a

13 files changed

+0
-42
lines changed

vm/tests/attr.py

-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3.4
2-
31
class C:
42
attr1 = 42
53
def __init__(self):
@@ -32,6 +30,4 @@ def __init__(self):
3230
assert c.attr2 == 101
3331
assert c.attr3 == 102
3432

35-
# End with this
3633
doc="finished"
37-
finished = True

vm/tests/class.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3.4
2-
31
doc="Test class definitions"
42
class C1:
53
"Test 1"
@@ -46,5 +44,4 @@ def method1(self, x):
4644
c = x()
4745
assert c.method1(1) == 2
4846

49-
# End with this
5047
doc="finished"

vm/tests/comprehensions.py

-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3.4
2-
31
doc="List comprehensions"
42
A = [1,2,3,4]
53
B = [ 2*a for a in A ]
@@ -27,6 +25,4 @@
2725
B = { k:k for k in ("a","b","c") }
2826
assert B["b"] == "b"
2927

30-
# End with this
3128
doc="finished"
32-
finished = True

vm/tests/exceptions.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3.4
2-
31
# Test exceptions
42

53
doc="except"
@@ -163,5 +161,4 @@
163161
ok = True
164162
assert ok, "ValueError not raised"
165163

166-
# End with this
167164
doc = "finished"

vm/tests/functions.py

-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3.4
2-
31
# Test functions
42
doc="fn"
53
def fn():
@@ -162,6 +160,4 @@ def fn12(*args,a=2,b=3,**kwargs) -> "RET":
162160

163161
#FIXME decorators
164162

165-
166-
# End with this
167163
doc="finished"

vm/tests/import_from.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3.4
2-
31
doc="IMPORT_FROM"
42

53
from lib import libfn, libvar, libclass
@@ -8,5 +6,4 @@
86
assert libvar == 43
97
assert libclass().method() == 44
108

11-
# End with this
129
doc="finished"

vm/tests/import_name.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3.4
2-
31
doc="IMPORT_NAME"
42

53
import lib
@@ -8,5 +6,4 @@
86
assert lib.libvar == 43
97
assert lib.libclass().method() == 44
108

11-
# End with this
129
doc="finished"

vm/tests/import_star.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3.4
2-
31
# test IMPORT_STAR
42

53
from lib import *
@@ -36,5 +34,4 @@
3634
ok = True
3735
assert ok
3836

39-
# End with this
4037
doc="finished"

vm/tests/lib.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3.4
2-
31
# Some targets to be imported
42

53
def libfn():

vm/tests/lib1.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3.4
2-
31
# Some targets to be imported
42

53
__all__ = [

vm/tests/lists.py

-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3.4
2-
31
L = [1,2,3]
42
T = (1,2,3)
53
assert L == [1,2,3]
@@ -98,6 +96,4 @@
9896
del L[:]
9997
assert L == []
10098

101-
# End with this
10299
doc="finished"
103-
finished = True

vm/tests/loops.py

-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3.4
2-
31
doc="While"
42
a = 1
53
while a < 10:
@@ -86,6 +84,4 @@
8684
assert a == 12
8785
assert ok
8886

89-
# End with this
9087
doc="finished"
91-
finished = True

vm/tests/ops.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3.4
2-
31
_2 = 2
42
_10 = 10
53
_11 = 11
@@ -130,5 +128,4 @@
130128
assert (t or t or f) == True
131129
assert (t or t or t) == True
132130

133-
# End with this
134131
doc="finished"

0 commit comments

Comments
 (0)