def test_vring(): R = vring("r", QQ) assert r == R.gens[0] R = vring("rb rbb rcc rzz _rx", QQ) assert rb == R.gens[0] assert rbb == R.gens[1] assert rcc == R.gens[2] assert rzz == R.gens[3] assert _rx == R.gens[4] R = vring(['rd', 're', 'rfg'], QQ) assert rd == R.gens[0] assert re == R.gens[1] assert rfg == R.gens[2] # see if vring() really injects into global namespace pytest.raises(NameError, lambda: r1) R = _make_r1() assert r1 == R.gens[0] pytest.raises(NameError, lambda: r2) R = _make_r2() assert r2 == R.gens[0]
def __make_r2(): return vring("r2", QQ)
def _make_r1(): return vring("r1", QQ)