Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lopt
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Software Public
PASSOFT
lopt
Commits
6a3fe3f6
Commit
6a3fe3f6
authored
4 years ago
by
Garrett Bates
Browse files
Options
Downloads
Plain Diff
Merge branch 'unit_tests' into 'master'
Unit tests See merge request passoft/lopt!7
parents
dfbefab0
295d0927
No related branches found
Branches containing commit
No related tags found
1 merge request
!7
Unit tests
Pipeline
#974
passed with stage
Stage: test
in 1 minute and 13 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+24
-6
24 additions, 6 deletions
.gitlab-ci.yml
tests/test_lopt.py
+9
-16
9 additions, 16 deletions
tests/test_lopt.py
tox.ini
+3
-11
3 additions, 11 deletions
tox.ini
with
36 additions
and
33 deletions
.gitlab-ci.yml
+
24
−
6
View file @
6a3fe3f6
...
...
@@ -20,17 +20,35 @@ stages:
before_script
:
-
pip install -e .[dev]
python2
:
image
:
python:2.7
linting
:
image
:
python:3.6
tags
:
-
passoft
stage
:
test
script
:
tox -e py27
script
:
-
flake8 lopt
-
flake8 tests
python3
:
python3
.6
:
image
:
python:3.6
tags
:
-
passoft
stage
:
test
script
:
tox -e py36
script
:
-
python -m unittest
python3.7
:
image
:
python:3.7
tags
:
-
passoft
stage
:
test
script
:
-
python -m unittest
python3.8
:
image
:
python:3.8
tags
:
-
passoft
stage
:
test
script
:
-
python -m unittest
This diff is collapsed.
Click to expand it.
tests/test_lopt.py
+
9
−
16
View file @
6a3fe3f6
...
...
@@ -4,25 +4,18 @@
"""
Tests for `lopt` package.
"""
import
unittest
import
sys
try
:
import
lopt
except
ImportError
:
pass
from
unittest.mock
import
patch
from
lopt.lopt
import
main
class
TestLopt
(
unittest
.
TestCase
):
"""
Tests for `lopt` package.
"""
def
setUp
(
self
):
"""
Set up test fixtures, if any.
"""
def
tearDown
(
self
):
"""
Tear down test fixtures, if any.
"""
def
test_import
(
self
):
if
'
lopt
'
in
sys
.
modules
:
self
.
assert_
(
True
,
"
lopt loaded
"
)
else
:
self
.
fail
()
"""
Test lopt import
"""
with
patch
(
'
sys.argv
'
,
[
'
lopt
'
,
'
-h
'
]):
with
self
.
assertRaises
(
SystemExit
)
as
cmd
:
main
()
self
.
assertEqual
(
cmd
.
exception
.
code
,
0
,
"
sys.exit(0) never called
"
"
- Failed to exercise lopt
"
)
This diff is collapsed.
Click to expand it.
tox.ini
+
3
−
11
View file @
6a3fe3f6
[tox]
envlist
=
py27, py36 flake8
[travis]
python
=
2.7:
py27
3.6:
py36
envlist
=
py36, py37, py38, flake8
[testenv:flake8]
basepython
=
python
deps
=
flake8
commands
=
flake8 lopt
flake8
tests
[testenv]
setenv
=
PYTHONPATH
=
{toxinidir}
commands
=
python setup.py test
commands
=
python -m unittest
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