File size: 557 Bytes
cb65407
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Copyright cocotb contributors
# Licensed under the Revised BSD License, see LICENSE for details.
# SPDX-License-Identifier: BSD-3-Clause
import os
import shutil
import subprocess

import cocotb


def test_version():
    if "dev" in cocotb.__version__ and os.path.exists(".git") and shutil.which("git"):
        assert "+" in cocotb.__version__
        parts = cocotb.__version__.split("+")
        rev = subprocess.check_output(
            ["git", "rev-parse", "--short", "HEAD"], universal_newlines=True
        ).strip()
        assert parts[1] == rev