Poetry 2.0 (January 2025) removed the poetry shell command from the core distribution. Running it prints an error saying the command is not defined. The replacement is poetry env activate, which does not spawn a subshell: it prints the activation command for your shell, so you either read it or evaluate it with eval $(poetry env activate).
The change was made because spawning a nested subshell caused a long tail of problems with shell configuration, exit codes and process trees, especially in CI. Printing a command is inspectable and composes with scripts.
If you want the old behaviour back, it lives on as an official plugin: poetry self add poetry-plugin-shell. For scripted use, prefer not activating at all and running poetry run pytest, which executes inside the environment without touching your shell. poetry env info --path prints the environment directory when you need the interpreter path for an editor or a Dockerfile.