MCPcopy Create free account
hub / github.com/dateutil/dateutil / test_tzstr_weakref

Function test_tzstr_weakref

tests/test_tz.py:1605–1621  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1603@pytest.mark.smoke
1604@pytest.mark.tzstr
1605def test_tzstr_weakref():
1606 tz_t1 = tz.tzstr('EST5EDT')
1607 tz_t2_ref = weakref.ref(tz.tzstr('EST5EDT'))
1608 assert tz_t1 is tz_t2_ref()
1609
1610 del tz_t1
1611 gc.collect()
1612
1613 assert tz_t2_ref() is not None
1614 assert tz.tzstr('EST5EDT') is tz_t2_ref()
1615
1616 for offset in range(5,15):
1617 tz.tzstr('GMT+{}'.format(offset))
1618 gc.collect()
1619
1620 assert tz_t2_ref() is None
1621 assert tz.tzstr('EST5EDT') is not tz_t2_ref()
1622
1623
1624@pytest.mark.tzstr

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected