summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2020-10-20 14:37:13 +0200
committeremkael <emkael@tlen.pl>2020-10-20 14:37:13 +0200
commitd170916f04a535d9e72ff453b18bbd351e356b7c (patch)
tree60fc0085ba8c748b91bc3d142dc79c086da4246e
parent34ce719920a7b25ec3183ee4a9ee1af5e59e72b3 (diff)
Test output goes into a known path, instead of temp (for easier inspection)
-rw-r--r--test/tmp/.gitignore1
-rw-r--r--tests.py7
2 files changed, 5 insertions, 3 deletions
diff --git a/test/tmp/.gitignore b/test/tmp/.gitignore
new file mode 100644
index 0000000..72e8ffc
--- /dev/null
+++ b/test/tmp/.gitignore
@@ -0,0 +1 @@
+*
diff --git a/tests.py b/tests.py
index 4e9b8ee..3f7e4c5 100644
--- a/tests.py
+++ b/tests.py
@@ -8,7 +8,7 @@ from dealconvert import DealConverter
import pytest
-formats = ['ber', 'bhg', 'bri', 'cds', 'csv', 'dge', 'dlm', 'dup', 'lin', 'pbn', 'rzd']
+formats = ['ber', 'bhg', 'bri', 'rzd', 'cds', 'csv', 'dge', 'dlm', 'dup', 'lin', 'pbn']
format_files = ['test.' + f for f in formats] + ['test-jfr.pbn']
test_data = [(d[0], d[1], d[1] == 'test-jfr.pbn') for d in itertools.product(format_files, format_files)]
@@ -16,9 +16,10 @@ test_data = [(d[0], d[1], d[1] == 'test-jfr.pbn') for d in itertools.product(for
@pytest.mark.parametrize("input_file, output_file, jfr_only", test_data)
def test_conversion(input_file, output_file, jfr_only):
input_path = os.path.join(os.path.dirname(__file__), 'test', input_file)
- output_path = os.path.join(tempfile.mkdtemp(), output_file)
+ output_path = os.path.join(os.path.dirname(__file__), 'test', 'tmp', output_file)
ref_path = os.path.join(os.path.dirname(__file__), 'test', output_file)
- print(input_path, output_path, ref_path)
+ if os.path.exists(output_path):
+ os.remove(output_path)
converter = DealConverter(
input_path,
jfr_only=jfr_only)