The following creates a table in memory as expected when executed in the Python window [ArcGIS Pro 2.9, Windows 10]:
arcpy.CreateTable_management('memory','dataTable')
When I try to do the same thing in a Python toolbox tool (.pyt), the table does not appear to be created in memory (or anywhere else), although the call does not generate an error:
import arcpy
class Toolbox(object):
def __init__(self):
self.label = 'Create table in memory toolbox'
self.tools = [CreateTable]
class CreateTable(object):
def __init__(self):
self.label = 'Create table in memory tool'
self.canRunInBackground = False
def getParameterInfo(self):
return None
def isLicensed(self):
return True
def updateParameters(self, parameters):
return
def updateMessages(self, parameters):
return
def execute(self, parameters, messages):
arcpy.CreateTable_management('memory','dataTable')
return
If I use a file GDB instead of memory, both approaches succeed. Insights?