From 9d268b99ada3adf8559ebcb1b7b76237501618e1 Mon Sep 17 00:00:00 2001 From: Paul Kronenwetter Date: Sun, 29 May 2022 09:03:25 -0400 Subject: [PATCH] Add change to test directory for high SNR python tests. --- test/test_highsnr_stdio_C_P_datacx.py | 6 ++++++ test/test_highsnr_stdio_P_C_datacx.py | 6 ++++++ test/test_highsnr_stdio_P_P_datacx.py | 6 ++++++ test/test_highsnr_stdio_P_P_multi.py | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/test/test_highsnr_stdio_C_P_datacx.py b/test/test_highsnr_stdio_C_P_datacx.py index d1e8f6ec..b06550a6 100644 --- a/test/test_highsnr_stdio_C_P_datacx.py +++ b/test/test_highsnr_stdio_C_P_datacx.py @@ -20,6 +20,12 @@ except KeyError: FRAMESPERBURST = 1 TESTFRAMES = 3 +# For some reason, sometimes, this test requires the current directory to be `test`. +# Try to adapt dynamically. I still want to figure out why but as a workaround, +# I'm not completely dissatisfied. +if os.path.exists("test"): + os.chdir("test") + @pytest.mark.parametrize("bursts", [BURSTS, 2, 3]) @pytest.mark.parametrize("frames_per_burst", [FRAMESPERBURST, 2, 3]) diff --git a/test/test_highsnr_stdio_P_C_datacx.py b/test/test_highsnr_stdio_P_C_datacx.py index 41a5e1cf..f64d3303 100644 --- a/test/test_highsnr_stdio_P_C_datacx.py +++ b/test/test_highsnr_stdio_P_C_datacx.py @@ -20,6 +20,12 @@ except KeyError: FRAMESPERBURST = 1 TESTFRAMES = 3 +# For some reason, sometimes, this test requires the current directory to be `test`. +# Try to adapt dynamically. I still want to figure out why but as a workaround, +# I'm not completely dissatisfied. +if os.path.exists("test"): + os.chdir("test") + @pytest.mark.parametrize("bursts", [BURSTS, 2, 3]) @pytest.mark.parametrize("frames_per_burst", [FRAMESPERBURST, 2, 3]) diff --git a/test/test_highsnr_stdio_P_P_datacx.py b/test/test_highsnr_stdio_P_P_datacx.py index dc42412c..249fb25e 100644 --- a/test/test_highsnr_stdio_P_P_datacx.py +++ b/test/test_highsnr_stdio_P_P_datacx.py @@ -19,6 +19,12 @@ except KeyError: FRAMESPERBURST = 1 TESTFRAMES = 3 +# For some reason, sometimes, this test requires the current directory to be `test`. +# Try to adapt dynamically. I still want to figure out why but as a workaround, +# I'm not completely dissatisfied. +if os.path.exists("test"): + os.chdir("test") + @pytest.mark.parametrize("bursts", [BURSTS, 2, 3]) @pytest.mark.parametrize("frames_per_burst", [FRAMESPERBURST, 2, 3]) diff --git a/test/test_highsnr_stdio_P_P_multi.py b/test/test_highsnr_stdio_P_P_multi.py index 6f6a147b..4c96efdd 100644 --- a/test/test_highsnr_stdio_P_P_multi.py +++ b/test/test_highsnr_stdio_P_P_multi.py @@ -19,6 +19,12 @@ except KeyError: FRAMESPERBURST = 1 TESTFRAMES = 3 +# For some reason, sometimes, this test requires the current directory to be `test`. +# Try to adapt dynamically. I still want to figure out why but as a workaround, +# I'm not completely dissatisfied. +if os.path.exists("test"): + os.chdir("test") + @pytest.mark.parametrize("bursts", [BURSTS, 2, 3]) @pytest.mark.parametrize("frames_per_burst", [FRAMESPERBURST, 2, 3])