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

mocks #74

Merged
merged 1 commit into from
Jul 15, 2022
Merged

mocks #74

merged 1 commit into from
Jul 15, 2022

Conversation

alex-treebeard
Copy link
Member

Enable mocking variables by allowing metadata which causes nbmake to overwrite variables after a cell finishes.

issue: #72

example from unit test:

  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "nbmake": {
     "mock": {
      "x": 2,
      "y": "fish",
      "z": {
       "x": 42
      }
     }
    }
   },
   "outputs": [],
   "source": [
    "x = 5\n",
    "y = 'y'"
   ]
  },

@codecov
Copy link

codecov bot commented Jul 15, 2022

Codecov Report

Merging #74 (c85213c) into main (966edac) will decrease coverage by 0.74%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #74      +/-   ##
==========================================
- Coverage   92.46%   91.71%   -0.75%     
==========================================
  Files           4        4              
  Lines         146      157      +11     
==========================================
+ Hits          135      144       +9     
- Misses         11       13       +2     
Impacted Files Coverage Δ
src/nbmake/nb_run.py 92.10% <83.33%> (-1.75%) ⬇️

@alex-treebeard alex-treebeard merged commit 214162c into main Jul 15, 2022
@alex-treebeard alex-treebeard deleted the mocks branch July 15, 2022 13:05
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

Successfully merging this pull request may close these issues.

1 participant