diff --git a/.github/workflows/flake8.yaml b/.github/workflows/flake8.yaml index 82630f1..982a937 100644 --- a/.github/workflows/flake8.yaml +++ b/.github/workflows/flake8.yaml @@ -18,4 +18,4 @@ jobs: pip install flake8 - name: Run Flake8 # run: flake8 . --ignore=E266,E261,E265,W503 --max-line-length=120 --count - run: flake8 postprocess --ignore=E266,E261,E265,W503 --max-line-length=120 --count # only do postprocessing code + run: flake8 . --ignore=E266,E261,E265,W503 --max-line-length=120 --count # only do postprocessing code diff --git a/tests/sync/G.8272/time-error-in-locked-mode/1PPS-to-DPLL/plot.py b/tests/sync/G.8272/time-error-in-locked-mode/1PPS-to-DPLL/plot.py index f23a031..2739ff8 100755 --- a/tests/sync/G.8272/time-error-in-locked-mode/1PPS-to-DPLL/plot.py +++ b/tests/sync/G.8272/time-error-in-locked-mode/1PPS-to-DPLL/plot.py @@ -20,6 +20,7 @@ from vse_sync_pp.parsers.dpll import TimeErrorParser from vse_sync_pp.plot import Plotter, Axis, TIMESERIES + def main(): """Plot test data and print files output as JSON to stdout @@ -46,5 +47,6 @@ def main(): if not print_loj([item]): sys.exit(1) + if __name__ == '__main__': main() diff --git a/tests/sync/G.8272/time-error-in-locked-mode/1PPS-to-DPLL/testimpl.py b/tests/sync/G.8272/time-error-in-locked-mode/1PPS-to-DPLL/testimpl.py index 3f9dd28..7ed5fd4 100755 --- a/tests/sync/G.8272/time-error-in-locked-mode/1PPS-to-DPLL/testimpl.py +++ b/tests/sync/G.8272/time-error-in-locked-mode/1PPS-to-DPLL/testimpl.py @@ -25,6 +25,7 @@ CONFIG = joinpath(dirname(__file__), 'config.yaml') + def refimpl(filename, encoding='utf-8'): """A reference implementation for tests under: @@ -46,6 +47,7 @@ def refimpl(filename, encoding='utf-8'): 'analysis': analyzer.analysis, } + def main(): """Run this test and print test output as JSON to stdout""" aparser = ArgumentParser(description=main.__doc__) @@ -56,5 +58,6 @@ def main(): if not print_loj(output): sys.exit(1) + if __name__ == '__main__': main() diff --git a/tests/sync/G.8272/time-error-in-locked-mode/Constellation-to-GNSS-receiver/plot.py b/tests/sync/G.8272/time-error-in-locked-mode/Constellation-to-GNSS-receiver/plot.py index 9af698a..d533966 100755 --- a/tests/sync/G.8272/time-error-in-locked-mode/Constellation-to-GNSS-receiver/plot.py +++ b/tests/sync/G.8272/time-error-in-locked-mode/Constellation-to-GNSS-receiver/plot.py @@ -20,6 +20,7 @@ from vse_sync_pp.parsers.gnss import TimeErrorParser from vse_sync_pp.plot import Plotter, Axis, TIMESERIES + def main(): """Plot test data and print files output as JSON to stdout @@ -46,5 +47,6 @@ def main(): if not print_loj([item]): sys.exit(1) + if __name__ == '__main__': main() diff --git a/tests/sync/G.8272/time-error-in-locked-mode/Constellation-to-GNSS-receiver/testimpl.py b/tests/sync/G.8272/time-error-in-locked-mode/Constellation-to-GNSS-receiver/testimpl.py index 5f32837..6c0fd58 100755 --- a/tests/sync/G.8272/time-error-in-locked-mode/Constellation-to-GNSS-receiver/testimpl.py +++ b/tests/sync/G.8272/time-error-in-locked-mode/Constellation-to-GNSS-receiver/testimpl.py @@ -25,6 +25,7 @@ CONFIG = joinpath(dirname(__file__), 'config.yaml') + def refimpl(filename, encoding='utf-8'): """A reference implementation for tests under: @@ -46,6 +47,7 @@ def refimpl(filename, encoding='utf-8'): 'analysis': analyzer.analysis, } + def main(): """Run this test and print test output as JSON to stdout""" aparser = ArgumentParser(description=main.__doc__) @@ -56,5 +58,6 @@ def main(): if not print_loj(output): sys.exit(1) + if __name__ == '__main__': main() diff --git a/tests/sync/G.8272/time-error-in-locked-mode/DPLL-to-PHC/plot.py b/tests/sync/G.8272/time-error-in-locked-mode/DPLL-to-PHC/plot.py index a84ac0f..4f21cb3 100755 --- a/tests/sync/G.8272/time-error-in-locked-mode/DPLL-to-PHC/plot.py +++ b/tests/sync/G.8272/time-error-in-locked-mode/DPLL-to-PHC/plot.py @@ -20,6 +20,7 @@ from vse_sync_pp.parsers.ts2phc import TimeErrorParser from vse_sync_pp.plot import Plotter, Axis, TIMESERIES + def main(): """Plot test data and print files output as JSON to stdout @@ -46,5 +47,6 @@ def main(): if not print_loj([item]): sys.exit(1) + if __name__ == '__main__': main() diff --git a/tests/sync/G.8272/time-error-in-locked-mode/DPLL-to-PHC/testimpl.py b/tests/sync/G.8272/time-error-in-locked-mode/DPLL-to-PHC/testimpl.py index 7d8b9ad..c1d70e6 100755 --- a/tests/sync/G.8272/time-error-in-locked-mode/DPLL-to-PHC/testimpl.py +++ b/tests/sync/G.8272/time-error-in-locked-mode/DPLL-to-PHC/testimpl.py @@ -25,6 +25,7 @@ CONFIG = joinpath(dirname(__file__), 'config.yaml') + def refimpl(filename, encoding='utf-8'): """A reference implementation for tests under: @@ -44,6 +45,7 @@ def refimpl(filename, encoding='utf-8'): 'analysis': analyzer.analysis, } + def main(): """Run this test and print test output as JSON to stdout""" aparser = ArgumentParser(description=main.__doc__) @@ -54,5 +56,6 @@ def main(): if not print_loj(output): sys.exit(1) + if __name__ == '__main__': main() diff --git a/tests/sync/G.8272/time-error-in-locked-mode/PHC-to-SYS/plot.py b/tests/sync/G.8272/time-error-in-locked-mode/PHC-to-SYS/plot.py index 3cd4fda..0d2f5a8 100755 --- a/tests/sync/G.8272/time-error-in-locked-mode/PHC-to-SYS/plot.py +++ b/tests/sync/G.8272/time-error-in-locked-mode/PHC-to-SYS/plot.py @@ -20,6 +20,7 @@ from vse_sync_pp.parsers.phc2sys import TimeErrorParser from vse_sync_pp.plot import Plotter, Axis, TIMESERIES + def main(): """Plot test data and print files output as JSON to stdout @@ -46,5 +47,6 @@ def main(): if not print_loj([item]): sys.exit(1) + if __name__ == '__main__': main() diff --git a/tests/sync/G.8272/time-error-in-locked-mode/PHC-to-SYS/testimpl.py b/tests/sync/G.8272/time-error-in-locked-mode/PHC-to-SYS/testimpl.py index 0051269..f3578eb 100755 --- a/tests/sync/G.8272/time-error-in-locked-mode/PHC-to-SYS/testimpl.py +++ b/tests/sync/G.8272/time-error-in-locked-mode/PHC-to-SYS/testimpl.py @@ -25,6 +25,7 @@ CONFIG = joinpath(dirname(__file__), 'config.yaml') + def refimpl(filename, encoding='utf-8'): """A reference implementation for tests under: @@ -44,6 +45,7 @@ def refimpl(filename, encoding='utf-8'): 'analysis': analyzer.analysis, } + def main(): """Run this test and print test output as JSON to stdout""" aparser = ArgumentParser(description=main.__doc__) @@ -54,5 +56,6 @@ def main(): if not print_loj(output): sys.exit(1) + if __name__ == '__main__': main() diff --git a/tests/sync/G.8272/wander-MTIE-in-locked-mode/1PPS-to-DPLL/plot.py b/tests/sync/G.8272/wander-MTIE-in-locked-mode/1PPS-to-DPLL/plot.py index a19b30f..3ac5ac0 100755 --- a/tests/sync/G.8272/wander-MTIE-in-locked-mode/1PPS-to-DPLL/plot.py +++ b/tests/sync/G.8272/wander-MTIE-in-locked-mode/1PPS-to-DPLL/plot.py @@ -20,7 +20,7 @@ ) from collections import namedtuple -from vse_sync_pp.plot import Plotter, Axis, TIMESERIES +from vse_sync_pp.plot import Plotter, Axis from vse_sync_pp.parsers.dpll import TimeErrorParser from vse_sync_pp.analyzers.ppsdpll import MaxTimeIntervalErrorAnalyzer @@ -28,14 +28,16 @@ CONFIG = joinpath(dirname(__file__), 'config.yaml') + def plot_data(analyzer, output): """Plot data""" plotter = Plotter(Axis("tau observation window (s)", "tau", "log"), Axis("filtered MTIE (ns)", "mtie")) - Parsed = namedtuple('Parsed',('tau','mtie')) - for tau,sample in analyzer.toplot(): - plotter.append(Parsed(tau, sample)) + Parsed = namedtuple('Parsed', ('tau', 'mtie')) + for tau, sample in analyzer.toplot(): + plotter.append(Parsed(tau, sample)) plotter.plot_scatter(output) + def main(): """Plot test data and print files output as JSON to stdout @@ -65,5 +67,6 @@ def main(): if not print_loj([item]): sys.exit(1) + if __name__ == '__main__': main() diff --git a/tests/sync/G.8272/wander-MTIE-in-locked-mode/1PPS-to-DPLL/testimpl.py b/tests/sync/G.8272/wander-MTIE-in-locked-mode/1PPS-to-DPLL/testimpl.py index 3206bc6..7d783ff 100755 --- a/tests/sync/G.8272/wander-MTIE-in-locked-mode/1PPS-to-DPLL/testimpl.py +++ b/tests/sync/G.8272/wander-MTIE-in-locked-mode/1PPS-to-DPLL/testimpl.py @@ -25,6 +25,7 @@ CONFIG = joinpath(dirname(__file__), 'config.yaml') + def refimpl(filename, config, encoding='utf-8'): """A reference implementation for tests under: @@ -44,6 +45,7 @@ def refimpl(filename, config, encoding='utf-8'): 'analysis': analyzer.analysis, } + def main(): """Run this test and print test output as JSON to stdout""" aparser = ArgumentParser(description=main.__doc__) @@ -55,5 +57,6 @@ def main(): if not print_loj(output): sys.exit(1) + if __name__ == '__main__': main() diff --git a/tests/sync/G.8272/wander-MTIE-in-locked-mode/Constellation-to-GNSS-receiver/plot.py b/tests/sync/G.8272/wander-MTIE-in-locked-mode/Constellation-to-GNSS-receiver/plot.py index f621271..b4258b0 100755 --- a/tests/sync/G.8272/wander-MTIE-in-locked-mode/Constellation-to-GNSS-receiver/plot.py +++ b/tests/sync/G.8272/wander-MTIE-in-locked-mode/Constellation-to-GNSS-receiver/plot.py @@ -20,7 +20,7 @@ ) from collections import namedtuple -from vse_sync_pp.plot import Plotter, Axis, TIMESERIES +from vse_sync_pp.plot import Plotter, Axis from vse_sync_pp.parsers.gnss import TimeErrorParser from vse_sync_pp.analyzers.gnss import MaxTimeIntervalErrorAnalyzer @@ -28,14 +28,16 @@ CONFIG = joinpath(dirname(__file__), 'config.yaml') + def plot_data(analyzer, output): """Plot data""" plotter = Plotter(Axis("tau observation window (s)", "tau", "log"), Axis("filtered MTIE (ns)", "mtie")) - Parsed = namedtuple('Parsed',('tau','mtie')) - for tau,sample in analyzer.toplot(): - plotter.append(Parsed(tau, sample)) + Parsed = namedtuple('Parsed', ('tau', 'mtie')) + for tau, sample in analyzer.toplot(): + plotter.append(Parsed(tau, sample)) plotter.plot_scatter(output) + def main(): """Plot test data and print files output as JSON to stdout @@ -65,5 +67,6 @@ def main(): if not print_loj([item]): sys.exit(1) + if __name__ == '__main__': main() diff --git a/tests/sync/G.8272/wander-MTIE-in-locked-mode/Constellation-to-GNSS-receiver/testimpl.py b/tests/sync/G.8272/wander-MTIE-in-locked-mode/Constellation-to-GNSS-receiver/testimpl.py index f1501dc..efeda59 100755 --- a/tests/sync/G.8272/wander-MTIE-in-locked-mode/Constellation-to-GNSS-receiver/testimpl.py +++ b/tests/sync/G.8272/wander-MTIE-in-locked-mode/Constellation-to-GNSS-receiver/testimpl.py @@ -25,6 +25,7 @@ CONFIG = joinpath(dirname(__file__), 'config.yaml') + def refimpl(filename, config, encoding='utf-8'): """A reference implementation for tests under: @@ -44,6 +45,7 @@ def refimpl(filename, config, encoding='utf-8'): 'analysis': analyzer.analysis, } + def main(): """Run this test and print test output as JSON to stdout""" aparser = ArgumentParser(description=main.__doc__) @@ -55,5 +57,6 @@ def main(): if not print_loj(output): sys.exit(1) + if __name__ == '__main__': main() diff --git a/tests/sync/G.8272/wander-MTIE-in-locked-mode/DPLL-to-PHC/plot.py b/tests/sync/G.8272/wander-MTIE-in-locked-mode/DPLL-to-PHC/plot.py index 6c077a0..2f58de7 100755 --- a/tests/sync/G.8272/wander-MTIE-in-locked-mode/DPLL-to-PHC/plot.py +++ b/tests/sync/G.8272/wander-MTIE-in-locked-mode/DPLL-to-PHC/plot.py @@ -20,7 +20,7 @@ ) from collections import namedtuple -from vse_sync_pp.plot import Plotter, Axis, TIMESERIES +from vse_sync_pp.plot import Plotter, Axis from vse_sync_pp.parsers.ts2phc import TimeErrorParser from vse_sync_pp.analyzers.ts2phc import MaxTimeIntervalErrorAnalyzer @@ -28,14 +28,16 @@ CONFIG = joinpath(dirname(__file__), 'config.yaml') + def plot_data(analyzer, output): """Plot data""" plotter = Plotter(Axis("tau observation window (s)", "tau", "log"), Axis("filtered MTIE (ns)", "tdev")) - Parsed = namedtuple('Parsed',('tau','tdev')) - for tau,sample in analyzer.toplot(): - plotter.append(Parsed(tau, sample)) + Parsed = namedtuple('Parsed', ('tau', 'tdev')) + for tau, sample in analyzer.toplot(): + plotter.append(Parsed(tau, sample)) plotter.plot_scatter(output) + def main(): """Plot test data and print files output as JSON to stdout @@ -53,7 +55,7 @@ def main(): analyzer = MaxTimeIntervalErrorAnalyzer(Config.from_yaml(CONFIG)) with open_input(args.input) as fid: analyzer.collect(*parser.parse(fid)) - + # plot data output = f'{args.prefix}.png' plot_data(analyzer, output) @@ -65,5 +67,6 @@ def main(): if not print_loj([item]): sys.exit(1) + if __name__ == '__main__': main() diff --git a/tests/sync/G.8272/wander-MTIE-in-locked-mode/DPLL-to-PHC/testimpl.py b/tests/sync/G.8272/wander-MTIE-in-locked-mode/DPLL-to-PHC/testimpl.py index c9c4d91..b6dc59b 100755 --- a/tests/sync/G.8272/wander-MTIE-in-locked-mode/DPLL-to-PHC/testimpl.py +++ b/tests/sync/G.8272/wander-MTIE-in-locked-mode/DPLL-to-PHC/testimpl.py @@ -25,6 +25,7 @@ CONFIG = joinpath(dirname(__file__), 'config.yaml') + def refimpl(filename, config, encoding='utf-8'): """A reference implementation for tests under: @@ -44,6 +45,7 @@ def refimpl(filename, config, encoding='utf-8'): 'analysis': analyzer.analysis, } + def main(): """Run this test and print test output as JSON to stdout""" aparser = ArgumentParser(description=main.__doc__) @@ -55,5 +57,6 @@ def main(): if not print_loj(output): sys.exit(1) + if __name__ == '__main__': main() diff --git a/tests/sync/G.8272/wander-TDEV-in-locked-mode/1PPS-to-DPLL/plot.py b/tests/sync/G.8272/wander-TDEV-in-locked-mode/1PPS-to-DPLL/plot.py index fe35744..7b94cbd 100755 --- a/tests/sync/G.8272/wander-TDEV-in-locked-mode/1PPS-to-DPLL/plot.py +++ b/tests/sync/G.8272/wander-TDEV-in-locked-mode/1PPS-to-DPLL/plot.py @@ -20,7 +20,7 @@ ) from collections import namedtuple -from vse_sync_pp.plot import Plotter, Axis, TIMESERIES +from vse_sync_pp.plot import Plotter, Axis from vse_sync_pp.parsers.dpll import TimeErrorParser from vse_sync_pp.analyzers.ppsdpll import TimeDeviationAnalyzer @@ -28,14 +28,16 @@ CONFIG = joinpath(dirname(__file__), 'config.yaml') + def plot_data(analyzer, output): """Plot data""" plotter = Plotter(Axis("tau observation window (s)", "tau", "log"), Axis("filtered TDEV (ns)", "tdev")) - Parsed = namedtuple('Parsed',('tau','tdev')) - for tau,sample in analyzer.toplot(): - plotter.append(Parsed(tau, sample)) + Parsed = namedtuple('Parsed', ('tau', 'tdev')) + for tau, sample in analyzer.toplot(): + plotter.append(Parsed(tau, sample)) plotter.plot_scatter(output) + def main(): """Plot test data and print files output as JSON to stdout @@ -63,5 +65,6 @@ def main(): if not print_loj([item]): sys.exit(1) + if __name__ == '__main__': main() diff --git a/tests/sync/G.8272/wander-TDEV-in-locked-mode/1PPS-to-DPLL/testimpl.py b/tests/sync/G.8272/wander-TDEV-in-locked-mode/1PPS-to-DPLL/testimpl.py index 6509a7f..5384d1a 100755 --- a/tests/sync/G.8272/wander-TDEV-in-locked-mode/1PPS-to-DPLL/testimpl.py +++ b/tests/sync/G.8272/wander-TDEV-in-locked-mode/1PPS-to-DPLL/testimpl.py @@ -25,6 +25,7 @@ CONFIG = joinpath(dirname(__file__), 'config.yaml') + def refimpl(filename, encoding='utf-8'): """A reference implementation for tests under: @@ -46,6 +47,7 @@ def refimpl(filename, encoding='utf-8'): 'analysis': analyzer.analysis, } + def main(): """Run this test and print test output as JSON to stdout""" aparser = ArgumentParser(description=main.__doc__) @@ -56,5 +58,6 @@ def main(): if not print_loj(output): sys.exit(1) + if __name__ == '__main__': main() diff --git a/tests/sync/G.8272/wander-TDEV-in-locked-mode/Constellation-to-GNSS-receiver/plot.py b/tests/sync/G.8272/wander-TDEV-in-locked-mode/Constellation-to-GNSS-receiver/plot.py index 60677d6..b22531b 100755 --- a/tests/sync/G.8272/wander-TDEV-in-locked-mode/Constellation-to-GNSS-receiver/plot.py +++ b/tests/sync/G.8272/wander-TDEV-in-locked-mode/Constellation-to-GNSS-receiver/plot.py @@ -20,7 +20,7 @@ ) from collections import namedtuple -from vse_sync_pp.plot import Plotter, Axis, TIMESERIES +from vse_sync_pp.plot import Plotter, Axis from vse_sync_pp.parsers.gnss import TimeErrorParser from vse_sync_pp.analyzers.gnss import TimeDeviationAnalyzer @@ -28,14 +28,16 @@ CONFIG = joinpath(dirname(__file__), 'config.yaml') + def plot_data(analyzer, output): """Plot data""" plotter = Plotter(Axis("tau observation window (s)", "tau", "log"), Axis("filtered TDEV (ns)", "tdev")) - Parsed = namedtuple('Parsed',('tau','tdev')) - for tau,sample in analyzer.toplot(): - plotter.append(Parsed(tau, sample)) + Parsed = namedtuple('Parsed', ('tau', 'tdev')) + for tau, sample in analyzer.toplot(): + plotter.append(Parsed(tau, sample)) plotter.plot_scatter(output) + def main(): """Plot test data and print files output as JSON to stdout @@ -53,7 +55,7 @@ def main(): analyzer = TimeDeviationAnalyzer(Config.from_yaml(CONFIG)) with open_input(args.input) as fid: analyzer.collect(*parser.canonical(fid)) - + # plot data output = f'{args.prefix}.png' plot_data(analyzer, output) @@ -65,5 +67,6 @@ def main(): if not print_loj([item]): sys.exit(1) + if __name__ == '__main__': main() diff --git a/tests/sync/G.8272/wander-TDEV-in-locked-mode/Constellation-to-GNSS-receiver/testimpl.py b/tests/sync/G.8272/wander-TDEV-in-locked-mode/Constellation-to-GNSS-receiver/testimpl.py index 4846d63..b2a1dbd 100755 --- a/tests/sync/G.8272/wander-TDEV-in-locked-mode/Constellation-to-GNSS-receiver/testimpl.py +++ b/tests/sync/G.8272/wander-TDEV-in-locked-mode/Constellation-to-GNSS-receiver/testimpl.py @@ -25,6 +25,7 @@ CONFIG = joinpath(dirname(__file__), 'config.yaml') + def refimpl(filename, encoding='utf-8'): """A reference implementation for tests under: @@ -46,6 +47,7 @@ def refimpl(filename, encoding='utf-8'): 'analysis': analyzer.analysis, } + def main(): """Run this test and print test output as JSON to stdout""" aparser = ArgumentParser(description=main.__doc__) @@ -56,5 +58,6 @@ def main(): if not print_loj(output): sys.exit(1) + if __name__ == '__main__': main() diff --git a/tests/sync/G.8272/wander-TDEV-in-locked-mode/DPLL-to-PHC/plot.py b/tests/sync/G.8272/wander-TDEV-in-locked-mode/DPLL-to-PHC/plot.py index d539637..d9154a2 100755 --- a/tests/sync/G.8272/wander-TDEV-in-locked-mode/DPLL-to-PHC/plot.py +++ b/tests/sync/G.8272/wander-TDEV-in-locked-mode/DPLL-to-PHC/plot.py @@ -20,7 +20,7 @@ ) from collections import namedtuple -from vse_sync_pp.plot import Plotter, Axis, TIMESERIES +from vse_sync_pp.plot import Plotter, Axis from vse_sync_pp.parsers.ts2phc import TimeErrorParser from vse_sync_pp.analyzers.ts2phc import TimeDeviationAnalyzer @@ -28,14 +28,16 @@ CONFIG = joinpath(dirname(__file__), 'config.yaml') + def plot_data(analyzer, output): """Plot data""" plotter = Plotter(Axis("tau observation window (s)", "tau", "log"), Axis("filtered TDEV (ns)", "tdev")) - Parsed = namedtuple('Parsed',('tau','tdev')) - for tau,sample in analyzer.toplot(): - plotter.append(Parsed(tau, sample)) + Parsed = namedtuple('Parsed', ('tau', 'tdev')) + for tau, sample in analyzer.toplot(): + plotter.append(Parsed(tau, sample)) plotter.plot_scatter(output) + def main(): """Plot test data and print files output as JSON to stdout @@ -53,7 +55,7 @@ def main(): analyzer = TimeDeviationAnalyzer(Config.from_yaml(CONFIG)) with open_input(args.input) as fid: analyzer.collect(*parser.parse(fid)) - + # plot data output = f'{args.prefix}.png' plot_data(analyzer, output) @@ -65,5 +67,6 @@ def main(): if not print_loj([item]): sys.exit(1) + if __name__ == '__main__': main() diff --git a/tests/sync/G.8272/wander-TDEV-in-locked-mode/DPLL-to-PHC/testimpl.py b/tests/sync/G.8272/wander-TDEV-in-locked-mode/DPLL-to-PHC/testimpl.py index 46c5c5f..95df1c1 100755 --- a/tests/sync/G.8272/wander-TDEV-in-locked-mode/DPLL-to-PHC/testimpl.py +++ b/tests/sync/G.8272/wander-TDEV-in-locked-mode/DPLL-to-PHC/testimpl.py @@ -25,6 +25,7 @@ CONFIG = joinpath(dirname(__file__), 'config.yaml') + def refimpl(filename, config, encoding='utf-8'): """A reference implementation for tests under: @@ -44,6 +45,7 @@ def refimpl(filename, config, encoding='utf-8'): 'analysis': analyzer.analysis, } + def main(): """Run this test and print test output as JSON to stdout""" aparser = ArgumentParser(description=main.__doc__) @@ -55,5 +57,6 @@ def main(): if not print_loj(output): sys.exit(1) + if __name__ == '__main__': main()