aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/basics/memoryerror.py6
-rw-r--r--tests/io/file-with.py9
-rw-r--r--tests/misc/rge-sm.py2
3 files changed, 16 insertions, 1 deletions
diff --git a/tests/basics/memoryerror.py b/tests/basics/memoryerror.py
new file mode 100644
index 000000000..b4be420c3
--- /dev/null
+++ b/tests/basics/memoryerror.py
@@ -0,0 +1,6 @@
+l = list(range(10000))
+try:
+ 100000000 * l
+except MemoryError:
+ print('MemoryError')
+print(len(l), l[0], l[-1])
diff --git a/tests/io/file-with.py b/tests/io/file-with.py
index 235072164..ee1e70242 100644
--- a/tests/io/file-with.py
+++ b/tests/io/file-with.py
@@ -10,3 +10,12 @@ except:
# Note: CPython and us throw different exception trying to read from
# close file.
print("can't read file after with")
+
+
+# Regression test: test that exception in with initialization properly
+# thrown and doesn't crash.
+try:
+ with open('__non_existent', 'r'):
+ pass
+except OSError:
+ print("OSError")
diff --git a/tests/misc/rge-sm.py b/tests/misc/rge-sm.py
index 40c6029b4..1860f7a31 100644
--- a/tests/misc/rge-sm.py
+++ b/tests/misc/rge-sm.py
@@ -111,4 +111,4 @@ def singleTraj(system, trajStart, h=0.02, tend=1.0):
#phaseDiagram(sysSM, (lambda i, j: [0.354, 0.654, 1.278, 0.8 + 0.2 * i, 0.1 + 0.1 * j]), (lambda a: (a[4], a[5])), h=0.1, tend=math.log(10**17))
# initial conditions at M_Z
-singleTraj(sysSM, [0.354, 0.654, 1.278, 0.983, 0.131], h=0.1, tend=math.log(10**17)) # true values
+singleTraj(sysSM, [0.354, 0.654, 1.278, 0.983, 0.131], h=0.5, tend=math.log(10**17)) # true values