Trainer.test() is not working

I want to test a trained model using the test dataloader
test_dl = DataLoader(test_dataset, batch_size=BATCH_SIZE, shuffle=True, num_workers=4)

So, I tried with

results = trainer.test(dataloaders=test_dl)

gives the below error.

TypeError: test() got an unexpected keyword argument 'dataloaders'

I tried with the below instruction also

results = trainer.test(test_dl)

It gives.

AttributeError: 'DataLoader' object has no attribute 'log'

I guess you are using a higher-level API such as Lightning?
If so, check if this argument was added in a newer version (or was removed) etc.