jupyter / jupyter/jupyter_kernel_test

tests in files?

Open
#1 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
66
Forks
34
PR merge metrics
No merged PRs in 30d

Description

This is more like a suggestion, if you expect that there should be multiple tests and not only 5-10 per kernel.

In knitpy, I found it easier to write testcases by putting each testcase into two files, one with the input, one with the output. The actually test then looks like this:

```
from knitpy.tests import AbstractOutputTestCase, _add_test_cases
class OutputTestCase(AbstractOutputTestCase):
pass
_add_test_cases(OutputTestCase, "basics")
_add_test_cases(OutputTestCase, "chunk_options")
```

where 'basics' and 'chunk_options' are subdirs with files in it like 'test_name.pymd' and 'test_name.md' (pymd = input, md = output, *.md is generated on first test run, but must be manually checked and the file renamed to activate the test)

Implementation is here: https://github.com/JanSchulz/knitpy/blob/master/knitpy/tests/__init__.py

I think this nicely fits here too with names like 'tab_testname.input' and 'tab_testname.output' beeing one tab completition test named 'testname' which must produce the json structure in 'tab_testname.output'.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.