• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

quaquel / EMAworkbench / 18263587552

05 Oct 2025 07:57PM UTC coverage: 88.703% (+0.04%) from 88.664%
18263587552

Pull #422

github

web-flow
Merge 41b468ad6 into 592d0cd98
Pull Request #422: ruff fixes

53 of 73 new or added lines in 16 files covered. (72.6%)

2 existing lines in 2 files now uncovered.

7852 of 8852 relevant lines covered (88.7%)

0.89 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

23.26
/ema_workbench/examples/test_examples.py
1
import glob
1✔
2
import os
1✔
3
import sys
1✔
4
import traceback
1✔
5
from contextlib import contextmanager
1✔
6

7
set_backend = "import matplotlib\nmatplotlib.use('Agg')\n"
1✔
8

9

10
@contextmanager
1✔
11
def redirected_output(new_stdout=None, new_stderr=None):
1✔
12
    save_stdout = sys.stdout
×
13
    save_stderr = sys.stderr
×
14
    if new_stdout is not None:
×
15
        sys.stdout = new_stdout
×
16
    if new_stderr is not None:
×
17
        sys.stderr = new_stderr
×
18
    try:
×
19
        yield None
×
20
    finally:
21
        sys.stdout = save_stdout
×
22
        sys.stderr = save_stderr
×
23

24

25
def run_exectests(test_dir, log_path="exectests.log"):
1✔
26
    test_files = glob.glob(os.path.join(test_dir, "*.py"))
×
27
    test_files = sorted(ex for ex in test_files if ex[0] != "_")
×
28
    passed = []
×
29
    failed = []
×
NEW
30
    with open(log_path, "w") as f, redirected_output(new_stdout=f, new_stderr=f):
×
NEW
31
        for fname in test_files:
×
NEW
32
            print(f">> Executing '{fname}'")
×
NEW
33
            try:
×
NEW
34
                code = compile(set_backend + open(fname).read(), fname, "exec")
×
NEW
35
                exec(code, {"__name__": "__main__"}, {})
×
NEW
36
                passed.append(fname)
×
NEW
37
            except BaseException:
×
NEW
38
                traceback.print_exc()
×
NEW
39
                failed.append(fname)
×
40

41
    print(f">> Passed {len(passed)}/{len(test_files)} tests: ")
×
42
    print("Passed: " + ", ".join(passed))
×
43
    print("Failed: " + ", ".join(failed))
×
44
    print(f"See {log_path} for details")
×
45

46
    return passed, failed
×
47

48

49
if __name__ == "__main__":
1✔
50
    try:
×
51
        run_exectests(*sys.argv[1:])
×
52
    except BaseException:
×
53
        run_exectests(os.getcwd())
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc