diff --git a/rye/src/cli/test.rs b/rye/src/cli/test.rs index 05fe898a3c..f54c746e1e 100644 --- a/rye/src/cli/test.rs +++ b/rye/src/cli/test.rs @@ -23,7 +23,7 @@ pub struct Args { #[arg(short, long)] all: bool, /// Perform the operation on a specific package - #[arg(short, long)] + #[arg(short, long, conflicts_with = "all")] package: Vec, /// Use this pyproject.toml file #[arg(long, value_name = "PYPROJECT_TOML")] @@ -67,7 +67,7 @@ pub fn execute(cmd: Args) -> Result<(), Error> { .join("pytest") .with_extension(EXE_EXTENSION); - let projects = locate_projects(project, cmd.all, &cmd.package[..])?; + let projects = locate_projects(project, cmd.all | cmd.package.is_empty(), &cmd.package[..])?; if !pytest.is_file() { let has_pytest = has_pytest_dependency(&projects)?; @@ -83,6 +83,9 @@ pub fn execute(cmd: Args) -> Result<(), Error> { } for (idx, project) in projects.iter().enumerate() { + if project.workspace().is_some() && project.is_workspace_root() { + continue; + } if output != CommandOutput::Quiet { if idx > 0 { println!();