import os
def test_installation():
- expected_version = os.environ['GV_VERSION']
+ expected_version = os.environ.get('GV_VERSION')
+
+ # If $GV_VERSION is not set, run the CI step that derives it. This will fail
+ # if the user is in a snapshot directory without Git installed, but assume
+ # they can live with that.
+ if expected_version is None:
+ ROOT = os.path.join(os.path.dirname(__file__), '../../..')
+ expected_version = subprocess.check_output(['python3',
+ 'gen_version.py'], cwd=ROOT, universal_newlines=True).strip()
+
actual_version_string = subprocess.check_output(
[
'dot',