def assert_root(monkeypatch, expected_root):
    def assertion(root, unused_parse):
        assert root == expected_root
    monkeypatch.setattr(setuptools_scm, '_do_parse', assertion)
Patch version_from_scm to simply assert that root is expected root
dataset/ETHPy150Open blue-yonder/pyscaffold/pyscaffold/contrib/setuptools_scm/testing/test_basic_api.py/assert_root