File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -441,13 +441,14 @@ def test(
441441 ctx .invoke (build_cmd )
442442
443443 package = cfg .get ("tool.spin.package" , None )
444+ if package is None :
445+ print (
446+ "Please specify `package = packagename` under `tool.spin` section of `pyproject.toml`"
447+ )
448+ raise SystemExit (1 )
449+
444450 if (not pytest_args ) and (not tests ):
445- pytest_args = (package ,)
446- if pytest_args == (None ,):
447- print (
448- "Please specify `package = packagename` under `tool.spin` section of `pyproject.toml`"
449- )
450- sys .exit (1 )
451+ tests = package
451452
452453 site_path = _set_pythonpath ()
453454 if site_path :
@@ -496,12 +497,9 @@ def test(
496497 else :
497498 cmd = ["pytest" ]
498499
499- cwd = os .getcwd ()
500500 pytest_p = _run (
501- cmd + ([f"--rootdir={ site_path } " ] if site_path else []) + list (pytest_args ),
502- cwd = site_path ,
501+ cmd + list (pytest_args ),
503502 )
504- os .chdir (cwd )
505503
506504 if gcov :
507505 # Verify the tools are present
You can’t perform that action at this time.
0 commit comments