Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Python Package
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ASTRON Templates
Python Package
Commits
0f7dc5b0
Commit
0f7dc5b0
authored
2 years ago
by
Klaas Kliffen
Browse files
Options
Downloads
Patches
Plain Diff
Add example tests
parent
c4b73e1a
Branches
Branches containing commit
No related tags found
1 merge request
!5
Resolve CWG-11 "Features/ add tox"
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+2
-0
2 additions, 0 deletions
.gitignore
tests/requirements.txt
+2
-0
2 additions, 0 deletions
tests/requirements.txt
tests/test_cool_module.py
+13
-0
13 additions, 0 deletions
tests/test_cool_module.py
tox.ini
+2
-1
2 additions, 1 deletion
tox.ini
with
19 additions
and
1 deletion
.gitignore
+
2
−
0
View file @
0f7dc5b0
dist/*
*.egg-info
*.pyc
.coverage
This diff is collapsed.
Click to expand it.
tests/requirements.txt
+
2
−
0
View file @
0f7dc5b0
...
...
@@ -2,3 +2,5 @@ black
build
flake8
pylint
pytest
pytest-cov
This diff is collapsed.
Click to expand it.
tests/test_cool_module.py
0 → 100644
+
13
−
0
View file @
0f7dc5b0
"""
Testing of the Cool Module
"""
from
unittest
import
TestCase
from
map.cool_module
import
greeter
class
TestCoolModule
(
TestCase
):
"""
Test Case of the Cool Module
"""
def
test_greeter
(
self
):
"""
Testing that the greeter does not crash
"""
greeter
()
self
.
assertEqual
(
2
+
2
,
4
)
This diff is collapsed.
Click to expand it.
tox.ini
+
2
−
1
View file @
0f7dc5b0
...
...
@@ -16,6 +16,7 @@ deps =
-r{toxinidir}/tests/requirements.txt
commands
=
{envpython}
--version
{envpython}
-m
pytest
--cov
=
map
# Use generative name and command prefixes to reuse the same virtualenv
# for all linting jobs.
...
...
@@ -28,7 +29,7 @@ commands =
black:
{envpython}
-m
black
--version
black:
{envpython}
-m
black
--check
--diff
.
pylint:
{envpython}
-m
pylint
--version
pylint:
{envpython}
-m
pylint
map
pylint:
{envpython}
-m
pylint
map
tests
[testenv:build]
usedevelop
=
False
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment