Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
mt940
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tryton
mt940
Commits
c51e7ffd5abe
Commit
c51e7ffd5abe
authored
1 year ago
by
Cédric Krier
Browse files
Options
Downloads
Patches
Plain Diff
Test README with unittest discover
parent
3323e3e26d8a
No related branches found
No related tags found
1 merge request
!6
Test README with unittest discover
Pipeline
#75709
passed
1 year ago
Stage: check
Stage: test
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
mt940/test.py
+0
-30
0 additions, 30 deletions
mt940/test.py
mt940/test_readme.py
+16
-0
16 additions, 0 deletions
mt940/test_readme.py
setup.py
+0
-1
0 additions, 1 deletion
setup.py
tox.ini
+2
-2
2 additions, 2 deletions
tox.ini
with
18 additions
and
33 deletions
mt940/test.py
+
0
−
30
View file @
c51e7ffd
#!/usr/bin/env python
# This file is part of mt940. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
"""
Test MT940
"""
import
datetime
...
...
@@ -2,8 +1,7 @@
# This file is part of mt940. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
"""
Test MT940
"""
import
datetime
import
doctest
import
io
import
os
...
...
@@ -8,6 +6,5 @@
import
io
import
os
import
sys
import
unittest
from
decimal
import
Decimal
...
...
@@ -16,7 +13,6 @@
regiobank_description
)
here
=
os
.
path
.
dirname
(
__file__
)
readme
=
os
.
path
.
normpath
(
os
.
path
.
join
(
here
,
'
..
'
,
'
README
'
))
class
TestMT940
(
unittest
.
TestCase
):
...
...
@@ -234,29 +230,3 @@
bar
test
"""
self
.
assertEqual
(
regiobank_description
(
description
),
{})
def
test_suite
():
suite
=
additional_tests
()
loader
=
unittest
.
TestLoader
()
suite
.
addTests
(
loader
.
loadTestsFromTestCase
(
TestMT940
))
return
suite
def
additional_tests
():
suite
=
unittest
.
TestSuite
()
if
os
.
path
.
isfile
(
readme
):
suite
.
addTest
(
doctest
.
DocFileSuite
(
readme
,
module_relative
=
False
))
return
suite
def
main
():
suite
=
test_suite
()
runner
=
unittest
.
TextTestRunner
()
return
runner
.
run
(
suite
)
if
__name__
==
'
__main__
'
:
sys
.
path
.
insert
(
0
,
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))))
sys
.
exit
(
not
main
().
wasSuccessful
())
This diff is collapsed.
Click to expand it.
mt940/test_readme.py
0 → 100644
+
16
−
0
View file @
c51e7ffd
# This file is part of mt940. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
import
doctest
import
os
here
=
os
.
path
.
dirname
(
__file__
)
readme
=
os
.
path
.
normpath
(
os
.
path
.
join
(
here
,
'
..
'
,
'
README.rst
'
))
def
load_tests
(
loader
,
tests
,
pattern
):
if
os
.
path
.
isfile
(
readme
):
tests
.
addTest
(
doctest
.
DocFileSuite
(
readme
,
module_relative
=
False
,
encoding
=
'
utf-8
'
,
optionflags
=
doctest
.
REPORT_ONLY_FIRST_FAILURE
))
return
tests
This diff is collapsed.
Click to expand it.
setup.py
+
0
−
1
View file @
c51e7ffd
...
...
@@ -55,5 +55,4 @@
'
Topic :: Utilities
'
,
],
license
=
'
BSD
'
,
test_suite
=
'
mt940.test
'
,
)
This diff is collapsed.
Click to expand it.
tox.ini
+
2
−
2
View file @
c51e7ffd
...
...
@@ -11,8 +11,8 @@
commands
=
coverage
run
--omit
=
*/tests/* -m xmlrunner discover -s mt940.test {posargs}
commands_post
=
coverage
report
--omit
=
README
coverage
xml
--omit
=
README
coverage
report
--omit
=
README
.rst
coverage
xml
--omit
=
README
.rst
deps
=
coverage
unittest-xml-reporting
...
...
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