From 751e379533172b9bfb0863643d2829446258f9cc Mon Sep 17 00:00:00 2001 From: Rami Ali Date: Mon, 16 Jan 2017 16:47:02 +1100 Subject: [PATCH] tests: Improve frozen import test coverage. --- tests/unix/extra_coverage.py | 6 ++++++ tests/unix/extra_coverage.py.exp | 1 + unix/coverage-frzmpy/frzmpy2.py | 1 + 3 files changed, 8 insertions(+) create mode 100644 unix/coverage-frzmpy/frzmpy2.py diff --git a/tests/unix/extra_coverage.py b/tests/unix/extra_coverage.py index ef1b50fda0..1c4cc6cf04 100644 --- a/tests/unix/extra_coverage.py +++ b/tests/unix/extra_coverage.py @@ -60,3 +60,9 @@ from frzstr_pkg2.mod import Foo print(Foo.x) from frzmpy_pkg2.mod import Foo print(Foo.x) + +# test raising exception in frozen script +try: + import frzmpy2 +except ZeroDivisionError: + print('ZeroDivisionError') diff --git a/tests/unix/extra_coverage.py.exp b/tests/unix/extra_coverage.py.exp index 8f62ccf51f..3694d97b4b 100644 --- a/tests/unix/extra_coverage.py.exp +++ b/tests/unix/extra_coverage.py.exp @@ -71,3 +71,4 @@ frzstr_pkg2.mod 1 frzmpy_pkg2.mod 1 +ZeroDivisionError diff --git a/unix/coverage-frzmpy/frzmpy2.py b/unix/coverage-frzmpy/frzmpy2.py new file mode 100644 index 0000000000..1ad930db2b --- /dev/null +++ b/unix/coverage-frzmpy/frzmpy2.py @@ -0,0 +1 @@ +raise ZeroDivisionError