Skip to content

Commit 992749d

Browse files
committed
Reverting LastPos and small refactoring
1 parent 248665f commit 992749d

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

azure_functions_worker/testutils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def _run_test(self, test, *args, **kwargs):
255255
test_exception = e
256256

257257
try:
258-
self.host_stdout.seek(0)
258+
self.host_stdout.seek(last_pos)
259259
self.host_out = self.host_stdout.read()
260260
self.host_stdout_logger.error(
261261
f'Captured WebHost stdout from {self.host_stdout.name} '

tests/unittests/test_code_quality.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ class TestCodeQuality(unittest.TestCase):
1313
def test_mypy(self):
1414
try:
1515
import mypy # NoQA
16-
except ImportError:
17-
raise unittest.SkipTest('mypy module is missing')
16+
except ImportError as e:
17+
raise unittest.SkipTest('mypy module is missing') from e
1818

1919
try:
2020
subprocess.run(
@@ -26,16 +26,17 @@ def test_mypy(self):
2626
except subprocess.CalledProcessError as ex:
2727
if (sys.version_info[1] == 7
2828
and sys.version_info[2] == 3):
29-
raise unittest.SkipTest('Subprocess start failing for 3.7.3')
29+
raise unittest.SkipTest('Subprocess start failing for 3.7.3') \
30+
from ex
3031
output = ex.output.decode()
3132
raise AssertionError(
3233
f'mypy validation failed:\n{output}') from None
3334

3435
def test_flake8(self):
3536
try:
3637
import flake8 # NoQA
37-
except ImportError:
38-
raise unittest.SkipTest('flake8 moudule is missing')
38+
except ImportError as e:
39+
raise unittest.SkipTest('flake8 moudule is missing') from e
3940

4041
config_path = ROOT_PATH / '.flake8'
4142
if not config_path.exists():

0 commit comments

Comments
 (0)