Skip to content

Commit ca1b73f

Browse files
authored
Merge pull request #198 from yut23/avoid_history_cover
Don't save coverage setup and teardown to history
2 parents a9651c8 + f6742a8 commit ca1b73f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

nbval/_cover4.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def setup_coverage(config, kernel, floc, output_loc=None):
5757

5858
# Build setup command and execute in kernel:
5959
cmd = _python_setup % (data_file, source, config_file)
60-
msg_id = kernel.kc.execute(cmd, stop_on_error=False)
60+
msg_id = kernel.kc.execute(cmd, stop_on_error=False, store_history=False)
6161
kernel.await_idle(msg_id, 60) # A minute should be plenty to enable coverage
6262
else:
6363
warnings.warn_explicit(
@@ -78,7 +78,7 @@ def teardown_coverage(config, kernel, output_loc=None):
7878
language = kernel.language
7979
if language.startswith('python'):
8080
# Teardown code does not require any input, simply execute:
81-
msg_id = kernel.kc.execute(_python_teardown)
81+
msg_id = kernel.kc.execute(_python_teardown, store_history=False)
8282
kernel.await_idle(msg_id, 60) # A minute should be plenty to write out coverage
8383

8484
# Ensure we merge our data into parent data of pytest-cov, if possible

nbval/_cover5.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def setup_coverage(config, kernel, floc, output_loc=None):
5959

6060
# Build setup command and execute in kernel:
6161
cmd = _python_setup % (data_file, source, config_file)
62-
msg_id = kernel.kc.execute(cmd, stop_on_error=False)
62+
msg_id = kernel.kc.execute(cmd, stop_on_error=False, store_history=False)
6363
kernel.await_idle(msg_id, 60) # A minute should be plenty to enable coverage
6464
else:
6565
warnings.warn_explicit(
@@ -80,7 +80,7 @@ def teardown_coverage(config, kernel, output_loc=None):
8080
language = kernel.language
8181
if language.startswith('python'):
8282
# Teardown code does not require any input, simply execute:
83-
msg_id = kernel.kc.execute(_python_teardown)
83+
msg_id = kernel.kc.execute(_python_teardown, store_history=False)
8484
kernel.await_idle(msg_id, 60) # A minute should be plenty to write out coverage
8585

8686
else:

0 commit comments

Comments
 (0)