Skip to content

Three tests run whichever layup is first on PATH, not the one under test #500

Description

@matthewholman

test_predict.py:223, test_predict.py (get_onsky_data) and
test_comet.py:216 invoke the CLI as a subprocess:

result = subprocess.run(["layup", "predict", str(input_file), ...])
assert result.returncode == 0

"layup" resolves against PATH, so the test exercises whatever installation
comes first -- not necessarily the working tree. On this machine that is a conda
env with a broken assist/rebound link, and all three fail with
assert 1 == 0 and an unrelated OSError: dlopen ... librebound...so. Putting
the intended environment's bin first makes all three pass, with no code change.

The failure mode is the bad one: it looks like a code regression, and the real
message is buried in captured stderr. It can also pass for the wrong reason,
testing a stale install while the working tree is broken.

Suggest [sys.executable, "-m", ...], or resolving the entry point relative to
sys.executable, so the subprocess inherits the interpreter under test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions