<s> from pypy . objspace . std . test import test_typeobject <EOL> from pypy . conftest import gettestobjspace <EOL> class TestVersionedType ( test_typeobject . TestTypeObject ) : <EOL> def setup_class ( cls ) : <EOL> cls . space = gettestobjspace ( ** { "<STR_LIT>" : True } ) <EOL> def get_three_classes ( self ) : <EOL> space = self . space <EOL> w_types = space . appexec ( [ ] , """<STR_LIT>""" ) <EOL> return space . unpackiterable ( w_types ) <EOL> def test_tag_changes ( self ) : <EOL> space = self . space <EOL> w_A , w_B , w_C = self . get_three_classes ( ) <EOL> atag = w_A . version_tag <EOL> btag = w_B . version_tag <EOL> assert atag is not None <EOL> assert btag is not None <EOL> assert w_C . version_tag is None <EOL> assert atag is not btag <EOL> w_types = space . appexec ( [ w_A , w_B ] , """<STR_LIT>""" ) <EOL> assert w_B . version_tag is not btag <EOL> assert w_A . version_tag is atag <EOL> btag = w_B . version_tag <EOL> w_types = space . appexec ( [ w_A , w_B ] , """<STR_LIT>""" ) <EOL> assert w_B . version_tag is not btag <EOL> assert w_A . version_tag is not atag <EOL> atag = w_A . version_tag <EOL> btag = w_B . version_tag <EOL> assert atag is not btag <EOL> w_types = space . appexec ( [ w_A , w_B ] , """<STR_LIT>""" ) <EOL> assert w_B . version_tag is not btag <EOL> assert w_A . version_tag is not atag <EOL> atag = w_A . version_tag <EOL> btag = w_B . version_tag <EOL> assert atag is not btag <EOL> def test_tag_changes_when_bases_change ( self ) : <EOL> space = self . space <EOL> w_A , w_B , w_C = self . get_three_classes ( ) <EOL> atag = w_A . version_tag <EOL> btag = w_B . version_tag <EOL> w_types = space . appexec ( [ w_A , w_B , w_C ] , """<STR_LIT>""" ) <EOL> assert w_B . version_tag is not btag <EOL> def test_version_tag_of_builtin_types ( self ) : <EOL> space = self . space <EOL> assert space . w_list . version_tag is not None <EOL> assert space . w_dict . version_tag is not None <EOL> assert space . type ( space . sys ) . version_tag is None <EOL> assert space . w_type . version_tag is None <EOL> w_function = space . appexec ( [ ] , """<STR_LIT>""" ) <EOL> assert w_function . version_tag is None <EOL> def test_version_tag_of_subclasses_of_builtin_types ( self ) : <EOL> space = self . space <EOL> w_types = space . appexec ( [ ] , """<STR_LIT>""" ) <EOL> ( w_LIST , w_DICT , w_TYPE , w_MODULE , <EOL> w_OBJECT ) = space . unpackiterable ( w_types ) <EOL> assert w_LIST . version_tag is not None <EOL> assert w_DICT . version_tag is not None <EOL> assert w_TYPE . version_tag is None <EOL> assert w_MODULE . version_tag is None <EOL> assert w_OBJECT . version_tag is not None <EOL> class AppTestVersionedType ( test_typeobject . AppTestTypeObject ) : <EOL> def setup_class ( cls ) : <EOL> cls . space = gettestobjspace ( ** { "<STR_LIT>" : True } ) </s>
