import os
import matplotlib.pyplot as plt


def test_examples():
    # run all the examples in the following folders
    pathnames = ['examples']
    cwd = os.getcwd()
    # Turn interactive mode on, so that the figures do not block the main thread
    plt.ion()
    for pathname in pathnames:
        os.chdir(cwd)
        files = os.listdir(pathname)
        os.chdir(pathname)
        for file in files:
            if file.endswith('.py'):
                print('testing example ' + file)
                exec (open(file).read())
                # close the figures again
                plt.close('all')

    os.chdir(cwd)
    return 'all examples work!'

@@ -3,16 +3,17 @@
 port os%0A
+%0A
 import m
@@ -58,17 +58,16 @@
 mple
-s
 ():%0A    
 # ru
@@ -66,187 +66,291 @@
     
-# run all the examples in the following folders%0A    pathnames = %5B'examples'%5D%0A    cwd = os.getcwd()%0A    # Turn interactive mode on, so that the figures do not block the main th
+plt.ion()%0A    cwd = os.getcwd()%0A    os.chdir(%22examples%22)%0A    exec(open(%22example.py%22).read())%0A    plt.close('all')%0A    os.chdir(cwd)%0A    return%0A%0A%0Adef test_example_menyanthes():%0A    plt.ion()%0A    cwd = os.getcwd()%0A    os.chdir(%22examples%22)%0A    exec(open(%22example_menyanthes.py%22).
 read
+())
 %0A   
@@ -358,264 +358,694 @@
 plt.
-ion()%0A    for pathname in pathnames:%0A        os.chdir(cwd)%0A        files = os.listdir(pathname)%0A        os.chdir(pathname)%0A        for file in files:%0A            if file.endswith('.py'):%0A                print('testing example ' + file)%0A            
+close('all')%0A    os.chdir(cwd)%0A    return%0A%0A%0Adef test_example_project():%0A    plt.ion()%0A    cwd = os.getcwd()%0A    os.chdir(%22examples%22)%0A    exec(open(%22example_project.py%22).read())%0A    plt.close('all')%0A    os.chdir(cwd)%0A    return%0A%0A%0Adef test_example_docs():%0A    plt.ion()%0A    cwd = os.getcwd()%0A    os.chdir(%22examples%22)%0A    exec(open(%22example_docs.py%22).read())%0A    plt.close('all')%0A    os.chdir(cwd)%0A    return%0A%0A%0Adef test_example_stats():%0A    plt.ion()%0A    cwd = os.getcwd()%0A    os.chdir(%22examples%22)%0A    exec(open(%22example_stats.py%22).read())%0A    plt.close('all')%0A    os.chdir(cwd)%0A    return%0A%0A%0Adef test_example_no_conv():%0A    plt.ion()%0A    cwd = os.getcwd()%0A    os.chdir(%22examples%22)%0A
     exec
  (op
@@ -1044,83 +1044,233 @@
 exec
- 
 (open(
-file).read())%0A                # close the figures again%0A            
+%22example_no_conv.py%22).read())%0A    plt.close('all')%0A    os.chdir(cwd)%0A    return%0A%0A%0Adef test_example_WellModel():%0A    plt.ion()%0A    cwd = os.getcwd()%0A    os.chdir(%22examples%22)%0A    exec(open(%22example_WellModel.py%22).read())%0A
     
@@ -1286,17 +1286,16 @@
 ('all')%0A
-%0A
     os.c
@@ -1318,26 +1318,224 @@
 turn
- 'all examples work!'
+%0A%0A%0Adef test_example_timestep_weighted_resample():%0A    plt.ion()%0A    cwd = os.getcwd()%0A    os.chdir(%22examples%22)%0A    exec(open(%22example_timestep_weighted_resample.py%22).read())%0A    plt.close('all')%0A    return os.chdir(cwd)
 %0A

Update of test_003