3434from newrelic .api .datastore_trace import DatastoreTrace
3535from newrelic .api .external_trace import ExternalTrace
3636from newrelic .api .function_trace import FunctionTrace , function_trace
37- from newrelic .api .graphql_trace import GraphQLOperationTrace , GraphQLResolverTrace
3837from newrelic .api .memcache_trace import MemcacheTrace
3938from newrelic .api .message_trace import MessageTrace
4039from newrelic .api .solr_trace import SolrTrace
@@ -125,8 +124,6 @@ def _test():
125124 (DatastoreTrace , ("db_product" , "db_target" , "db_operation" )),
126125 (ExternalTrace , ("lib" , "url" )),
127126 (FunctionTrace , ("name" ,)),
128- (GraphQLOperationTrace , ()),
129- (GraphQLResolverTrace , ()),
130127 (MemcacheTrace , ("command" ,)),
131128 (MessageTrace , ("lib" , "operation" , "dst_type" , "dst_name" )),
132129 (SolrTrace , ("lib" , "command" )),
@@ -416,11 +413,11 @@ def _test():
416413@pytest .mark .parametrize ("collect_span_events" , (False , True ))
417414@pytest .mark .parametrize ("span_events_enabled" , (False , True ))
418415def test_collect_span_events_override (collect_span_events , span_events_enabled ):
419-
420- if collect_span_events and span_events_enabled :
421- spans_expected = True
422- else :
423- spans_expected = False
416+ spans_expected = collect_span_events and span_events_enabled
417+ # if collect_span_events and span_events_enabled:
418+ # spans_expected = True
419+ # else:
420+ # spans_expected = False
424421
425422 span_count = 2 if spans_expected else 0
426423
@@ -556,9 +553,9 @@ def _test():
556553def test_span_user_attribute_overrides_transaction_attribute ():
557554 transaction = current_transaction ()
558555
559- transaction .add_custom_attribute ("foo" , "a" )
556+ transaction .add_custom_parameter ("foo" , "a" )
560557 add_custom_span_attribute ("foo" , "b" )
561- transaction .add_custom_attribute ("foo" , "c" )
558+ transaction .add_custom_parameter ("foo" , "c" )
562559
563560
564561@override_application_settings ({"attributes.include" : "*" })
@@ -603,7 +600,7 @@ def _test():
603600 transaction = current_transaction ()
604601
605602 for i in range (128 ):
606- transaction .add_custom_attribute ("txn_attr%i" % i , "txnValue" )
603+ transaction .add_custom_parameter ("txn_attr%i" % i , "txnValue" )
607604 if i < 64 :
608605 add_custom_span_attribute ("span_attr%i" % i , "spanValue" )
609606
@@ -620,8 +617,6 @@ def _test():
620617 (DatastoreTrace , ("db_product" , "db_target" , "db_operation" )),
621618 (ExternalTrace , ("lib" , "url" )),
622619 (FunctionTrace , ("name" ,)),
623- (GraphQLOperationTrace , ()),
624- (GraphQLResolverTrace , ()),
625620 (MemcacheTrace , ("command" ,)),
626621 (MessageTrace , ("lib" , "operation" , "dst_type" , "dst_name" )),
627622 (SolrTrace , ("lib" , "command" )),
@@ -671,8 +666,6 @@ def _test():
671666 (DatastoreTrace , ("db_product" , "db_target" , "db_operation" )),
672667 (ExternalTrace , ("lib" , "url" )),
673668 (FunctionTrace , ("name" ,)),
674- (GraphQLOperationTrace , ()),
675- (GraphQLResolverTrace , ()),
676669 (MemcacheTrace , ("command" ,)),
677670 (MessageTrace , ("lib" , "operation" , "dst_type" , "dst_name" )),
678671 (SolrTrace , ("lib" , "command" )),
@@ -716,8 +709,6 @@ def _test():
716709 (DatastoreTrace , ("db_product" , "db_target" , "db_operation" )),
717710 (ExternalTrace , ("lib" , "url" )),
718711 (FunctionTrace , ("name" ,)),
719- (GraphQLOperationTrace , ()),
720- (GraphQLResolverTrace , ()),
721712 (MemcacheTrace , ("command" ,)),
722713 (MessageTrace , ("lib" , "operation" , "dst_type" , "dst_name" )),
723714 (SolrTrace , ("lib" , "command" )),
@@ -732,9 +723,9 @@ def test_span_event_notice_error_overrides_observed(trace_type, args):
732723 with trace_type (* args ):
733724 try :
734725 raise ERROR
735- except :
726+ except Exception :
736727 notice_error ()
737- raise ValueError
728+ raise ValueError # pylint: disable
738729 except ValueError :
739730 pass
740731
0 commit comments