Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
Unitgrade
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
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
tuhe
Unitgrade
Commits
5d01c8d9
Commit
5d01c8d9
authored
1 year ago
by
tuhe
Browse files
Options
Downloads
Patches
Plain Diff
Updated how the hidden tests are found
parent
674c90a8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/unitgrade/utils.py
+20
-4
20 additions, 4 deletions
src/unitgrade/utils.py
with
20 additions
and
4 deletions
src/unitgrade/utils.py
+
20
−
4
View file @
5d01c8d9
...
@@ -258,10 +258,26 @@ def methodsWithDecorator(cls, decorator):
...
@@ -258,10 +258,26 @@ def methodsWithDecorator(cls, decorator):
print(inspect.getsourcelines(f) ) # How to get all hidden questions.
print(inspect.getsourcelines(f) ) # How to get all hidden questions.
"""
"""
for
maybeDecorated
in
cls
.
__dict__
.
values
():
for
maybeDecorated
in
cls
.
__dict__
.
values
():
if
hasattr
(
maybeDecorated
,
'
decorator
'
):
from
types
import
FunctionType
if
maybeDecorated
.
decorator
==
decorator
:
print
(
maybeDecorated
)
def
extract_wrapped
(
decorated
):
yield
maybeDecorated
if
decorated
.
__closure__
is
None
:
return
decorated
closure
=
(
c
.
cell_contents
for
c
in
decorated
.
__closure__
)
return
next
((
c
for
c
in
closure
if
isinstance
(
c
,
FunctionType
)),
None
)
import
inspect
if
inspect
.
isfunction
(
maybeDecorated
):
# elif not isinstance(maybeDecorated, func):
f
=
extract_wrapped
(
maybeDecorated
)
source
,
position
=
inspect
.
getsourcelines
(
f
)
for
l
in
source
:
if
l
.
strip
().
startswith
(
"
@hide
"
):
yield
f
# if hasattr(maybeDecorated, 'decorator'):
# if maybeDecorated.decorator == decorator:
# print(maybeDecorated)
# yield maybeDecorated
"""
Methods responsible for turning a dictionary into a string that can be pickled or put into a json file.
"""
"""
Methods responsible for turning a dictionary into a string that can be pickled or put into a json file.
"""
...
...
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