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

Add tests for cell/test correspondence, and test skipping #111

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .azure/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ jobs:
make lint
displayName: 'Lint'

- script:
make tests
displayName: 'Test'

- ${{ if eq(parameters.also_forked, 'true') }}:

- script:
make testpy-forked
displayName: 'pytest --forked'

- script:
make tests
displayName: 'Test'

- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
Expand Down
80 changes: 80 additions & 0 deletions nbcelltests/tests/_cell_counting.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"tests": [
"assert x == 1"
]
},
"outputs": [],
"source": [
"x = 1"
]
},
{
"cell_type": "markdown",
"source": [
"some markdown"
],
"metadata": {}
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"tests": [
"%cell\n",
"assert x == 2"
]
},
"outputs": [],
"source": [
"x = 2"
]
},
{
"cell_type": "raw",
"source": [
"raw"
],
"metadata": {}
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"tests": [
"%cell\n",
"assert x == 3"
]
},
"outputs": [],
"source": [
"x = 3"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
38 changes: 38 additions & 0 deletions nbcelltests/tests/_non_code_cell.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"cells": [
{
"cell_type": "markdown",
"source": [
"some markdown"
],
"metadata": {
"tests": [
"# Use %cell to execute the cell\n",
"pass\n",
"\n"
]
}
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.7.6 64-bit ('celltestsui': conda)",
"language": "python",
"name": "python37664bitcelltestsuiconda549e14be7f784a2fbde278c18c8be829"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
91 changes: 91 additions & 0 deletions nbcelltests/tests/_skips.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"tests": [
"pass"
]
},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"# nothing to see here"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"x = 1"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"tests": [
"# nothing to see here"
]
},
"outputs": [],
"source": [
"x = 1"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"tests": []
},
"outputs": [],
"source": [
"x = 1"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"tests": [
"x = 2"
]
},
"outputs": [],
"source": [
"x = 1"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Loading