def _test_wild_factor():
    w = Symbol('w')
    p = (w ** 2)
    s = Symbol('s')
    t = Symbol('t')
    wargs = ({}, ([w], [True]))
    assert (p.matches(s, *wargs) == None)
    assert (p.matches((s ** 2), *wargs) == {w: s})
    assert (p.matches((s ** 3), *wargs) == None)
    assert (p.matches((s + 2), *wargs) == None)
    assert (p.matches((s * 2), *wargs) == None)
    assert (p.matches(((s ** 2) * 2), *wargs) == None)
    assert (p.matches(((s ** 2) * (t ** 3)), *wargs) == None)
def _test_wild_factor():
    w = Symbol('w')
    p = (w ** 2)
    s = Symbol('s')
    t = Symbol('t')
    wargs = ({}, ([w], [True]))
    assert (p.matches(s, *wargs) == None)
    assert (p.matches((s ** 2), *wargs) == {w: s})
    assert (p.matches((s ** 3), *wargs) == None)
    assert (p.matches((s + 2), *wargs) == None)
    assert (p.matches((s * 2), *wargs) == None)
    assert (p.matches(((s ** 2) * 2), *wargs) == None)
    assert (p.matches(((s ** 2) * (t ** 3)), *wargs) == None)