Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

top-level test.fixture keys don't support extname/content #291

Open
jhheider opened this issue Jan 25, 2024 · 2 comments
Open

top-level test.fixture keys don't support extname/content #291

jhheider opened this issue Jan 25, 2024 · 2 comments

Comments

@jhheider
Copy link
Contributor

pkgxdev/pantry@f53024f

it seems like fixture should work the same at the top level (or be removed? except shared fixtures would suffer.) as it does in script steps.

related: it might be useful for top-level (and even step-level) fixtures to support a name key, and an array of objects. that'd allow for:

test:
  fixture:
    - {
      - name: a
      - extname: py
      - content: print("fixture a")
      }
    - {
      - name: b
      - extname: py
      - content: print("fixture b")
      }
  script:
    - python $FIXTURE_a
    - python $FIXTURE_b

though we don't need this (yet). but it does provide one possible way to get rid of fixtures/props in the git repo (by moving them into the yaml). if we did this, we might want to let fixtures and props be top-level keys, so they could be segregated to the bottom to prevent visual clutter.

thoughts and ideas.

@mxcl
Copy link
Member

mxcl commented Jan 25, 2024

probs we should remove the top-level fixture.

The above example though artificial would be better as inline fixtures per array node imo.

In the case where you want fixtures that maybe are more global then bundle them in the pantry as props.

@jhheider
Copy link
Contributor Author

The above example though artificial would be better as inline fixtures per array node imo.

yes, i'm thinking of the cases where a node needs 2 or more fixtures, or a fixture is used across multiple nodes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants