Make dynamo tests work under pytest (#93251)
This now runs without error:
```
pytest test/dynamo
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/93251
Approved by: https://github.com/ezyang, https://github.com/voznesenskym, https://github.com/mlazos