<p>Maybe that's better, yes. The extra overhead of always compiling the script is probably nothing compared to the time the test runs anyway.</p>
<p>I just tested this patch and it works well:</p>
<pre><code>diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index b8ce786..92f8243 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -92,7 +92,7 @@ if (PYTHONINTERP_FOUND)
     configure_file(${CMAKE_CURRENT_SOURCE_DIR}/regression-test.py.in
                    ${CMAKE_CURRENT_BINARY_DIR}/regression-test.py)
     add_test(NAME regression-test-pbf
-             COMMAND ${CMAKE_CURRENT_BINARY_DIR}/regression-test.py)
+             COMMAND ${PYTHON_EXECUTABLE} -B ${CMAKE_CURRENT_BINARY_DIR}/regression-test.py)
     set_tests_properties(regression-test-pbf PROPERTIES TIMEOUT ${TESTING_TIMEOUT})
     set_tests_properties(regression-test-pbf
                          PROPERTIES FIXTURES_REQUIRED Tablespace)
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/osm2pgsql/pull/1005?email_source=notifications&email_token=AA6353U6GXTI7SBE4TV2T3LQVZZV5A5CNFSM4JSE2I32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFJQTBA#issuecomment-559090052">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AA6353QEQK2242NXPSEWLWTQVZZV5ANCNFSM4JSE2I3Q">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AA6353SH3EQT2VSLR5H46FTQVZZV5A5CNFSM4JSE2I32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFJQTBA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/osm2pgsql/pull/1005?email_source=notifications\u0026email_token=AA6353U6GXTI7SBE4TV2T3LQVZZV5A5CNFSM4JSE2I32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFJQTBA#issuecomment-559090052",
"url": "https://github.com/openstreetmap/osm2pgsql/pull/1005?email_source=notifications\u0026email_token=AA6353U6GXTI7SBE4TV2T3LQVZZV5A5CNFSM4JSE2I32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFJQTBA#issuecomment-559090052",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>