diff --git a/tests/test_empty.yaml b/tests/test_empty.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/tests/test_pieces.py b/tests/test_pieces.py index c3cf36c..4c20654 100644 --- a/tests/test_pieces.py +++ b/tests/test_pieces.py @@ -18,6 +18,17 @@ def test_rootio(): rom.configure({'target': ''}) rom.finalize() + # this is also for coverage completeness (see that we get everything if no selector is set for the input module) + import subprocess + chk = subprocess.run("python -m histgrinder.make_sample_file", + shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + print(chk.stdout) + chk.check_returncode() + + rim.configure({'source': 'example.root'}) + inputs = list(rim.iterate(dryrun=True)) + assert len(inputs) == 101 + def test_badconfig(): from histgrinder.config import read_configuration diff --git a/tests/test_run.py b/tests/test_run.py index b9a3f93..12617e7 100644 --- a/tests/test_run.py +++ b/tests/test_run.py @@ -41,10 +41,13 @@ def test_run_newfile(): pytest.importorskip("ROOT") import subprocess + import os.path chk = subprocess.run("python -m histgrinder.make_sample_file", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) print(chk.stdout) chk.check_returncode() + if os.path.exists('new.root'): + os.remove('new.root') chk = subprocess.run("python -m histgrinder.engine example.root new.root -c tests/test_functional.yaml --prefix prefix", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) print(chk.stdout) @@ -73,17 +76,20 @@ def test_run_absprefix(): pytest.importorskip("ROOT") import subprocess + import os.path chk = subprocess.run("python -m histgrinder.make_sample_file", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) print(chk.stdout) chk.check_returncode() - chk = subprocess.run("python -m histgrinder.engine example.root example.root " + if os.path.exists('new.root'): + os.remove('new.root') + chk = subprocess.run("python -m histgrinder.engine example.root new.root " "-c tests/test_functional.yaml --prefix /prefix", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) print(chk.stdout) chk.check_returncode() - return content_verify() + return content_verify(newfile=True) def test_run_defer(): @@ -179,20 +185,6 @@ def test_run_bad_prefix(): chk.check_returncode() -def test_run_nocode(): - pytest.importorskip("ROOT") - - import subprocess - chk = subprocess.run("python -m histgrinder.make_sample_file", - shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - print(chk.stdout) - chk.check_returncode() - chk = subprocess.run("python -m histgrinder.engine example.root example.root -c tests/test_empty.yaml --prefix /prefix", - shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - print(chk.stdout) - chk.check_returncode() - - def test_run_badtype(): pytest.importorskip("ROOT")