Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
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
schwede
openstructure
Commits
23b52273
Unverified
Commit
23b52273
authored
1 year ago
by
Xavier Robin
Browse files
Options
Downloads
Patches
Plain Diff
refactor: move imports to beginning of file
parent
53fc5c9b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/base/pymod/testutils.py
+14
-12
14 additions, 12 deletions
modules/base/pymod/testutils.py
with
14 additions
and
12 deletions
modules/base/pymod/testutils.py
+
14
−
12
View file @
23b52273
import
inspect
import
sys
import
unittest
from
ost
import
xmlrunner
from
ost.conop
import
GetDefaultLib
def
RunTests
():
'''
"""
This function behaves as a custom TestLoader for python unittests.
With no system arguments, the default unittest TestRunner is used.
...
...
@@ -31,20 +39,15 @@ def RunTests():
from ost import testutils
testutils.RunTests()
'''
import
unittest
import
sys
"""
try
:
if
len
(
sys
.
argv
)
>
1
and
sys
.
argv
[
1
]
==
'
xml
'
:
import
inspect
import
types
if
len
(
sys
.
argv
)
>
1
and
sys
.
argv
[
1
]
==
'
xml
'
:
import
__main__
from
ost
import
xmlrunner
for
name
,
obj
in
inspect
.
getmembers
(
__main__
):
if
(
isinstance
(
obj
,
type
)
and
issubclass
(
obj
,
unittest
.
TestCase
)):
suite
=
unittest
.
TestLoader
().
loadTestsFromTestCase
(
obj
)
stream
=
open
(
'
PYTEST-%s.xml
'
%
name
,
'
w
'
)
stream
=
open
(
'
PYTEST-%s.xml
'
%
name
,
'
w
'
)
xmlrunner
.
XMLTestRunner
(
stream
).
run
(
suite
)
stream
.
close
()
...
...
@@ -55,13 +58,12 @@ def RunTests():
def
DefaultCompoundLibIsSet
():
'''
"""
This function checks if a default compound library is set.
:return: True, if a compound library was found and set to be accessed with
:func:`ost.conop.GetDefaultLib`. False otherwise.
'''
from
ost
.
conop
import
GetDefaultLib
"""
# check if already there
if
GetDefaultLib
():
return
True
...
...
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