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

Refactor jupyter magic unit tests with conftest #3585

Closed
Tracked by #3535
noklam opened this issue Feb 1, 2024 · 1 comment · Fixed by #3599
Closed
Tracked by #3535

Refactor jupyter magic unit tests with conftest #3585

noklam opened this issue Feb 1, 2024 · 1 comment · Fixed by #3599
Assignees

Comments

@noklam
Copy link
Contributor

noklam commented Feb 1, 2024

The current tests has a lot of hardcode string assertion.

Two things that we can improve:

  1. Move dummy functions to a conftest/, so when we need to retrieve the function body we can directly read the file as text, it's also easier to edit the test because the indention will not be weird indented string with """.
    image

  2. Refactor the function itself, so it returns data instead of the string of a function. We can then refactor our test to only test against the data. This should leave only 1 or 2 tests to assert with hardcoded string.
    image

Assert the function arguments instead of the whole # Prepare necessary inputs for debugging.......

@astrojuanlu
Copy link
Member

Nitpick (to clarify the terminology for potential observers): conftest.py is just the default location for pytest fixtures https://docs.pytest.org/en/stable/explanation/fixtures.html there can be module-specific fixtures too

@merelcht merelcht moved this to To Do in Kedro Framework Feb 5, 2024
@noklam noklam moved this from To Do to In Progress in Kedro Framework Feb 5, 2024
@astrojuanlu astrojuanlu moved this from In Progress to In Review in Kedro Framework Feb 6, 2024
@github-project-automation github-project-automation bot moved this from In Review to Done in Kedro Framework Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants