@@ -73,10 +73,9 @@ def temporaryDirectory( self ) :
7373
7474 def assertSetNamesEqual ( self , setNames1 , setNames2 ) :
7575
76- # Order isn't guaranteed, so sort before comparing
7776 self .assertEqual (
78- sorted ( [ str ( x ) for x in setNames1 ] ) ,
79- sorted ( [ str ( x ) for x in setNames2 ] )
77+ { str ( x ) for x in setNames1 } ,
78+ { str ( x ) for x in setNames2 }
8079 )
8180 # Duplicates are not allowed
8281 self .assertEqual ( len ( set ( setNames1 ) ), len ( setNames1 ) )
@@ -2373,7 +2372,14 @@ def testCustomAttributes( self ) :
23732372
23742373 def assertExpectedAttributes ( sphere ) :
23752374 # test expected attributes names
2376- self .assertEqual ( sorted ( sphere .attributeNames () ), sorted ( [ "user:notAConstantPrimVar" , "user:notAConstantPrimVarDeprecated" , "user:test" , "studio:foo" , "customNamespaced:testAnimated" , "user:bongo" , "render:test" , "ai:disp_height" , "ai:poly_mesh:subdiv_iterations" ] ) )
2375+ self .assertEqual (
2376+ set ( sphere .attributeNames () ),
2377+ {
2378+ "user:notAConstantPrimVar" , "user:notAConstantPrimVarDeprecated" , "user:test" ,
2379+ "studio:foo" , "customNamespaced:testAnimated" , "user:bongo" , "render:test" ,
2380+ "ai:disp_height" , "ai:poly_mesh:subdiv_iterations"
2381+ }
2382+ )
23772383
23782384 # test incompatible primvars hasAttribute/readAttribute
23792385 for name in [
@@ -2412,7 +2418,7 @@ def assertAttributesValues( sphere ):
24122418 self .assertEqual ( a .readAttribute ( "user:foo" , 0 ), IECore .StringData ( "yellow" ) )
24132419
24142420 b = a .child ( "b" )
2415- self .assertEqual ( sorted ( b .attributeNames () ), [ "render:notUserPrefixAttribute" , "user:baz" ] )
2421+ self .assertEqual ( set ( b .attributeNames () ), { "render:notUserPrefixAttribute" , "user:baz" } )
24162422 for n in b .attributeNames ():
24172423 self .assertTrue ( b .hasAttribute ( n ) )
24182424 # Make sure primvars and indices not loaded as attributes
0 commit comments