Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-lister
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Antoine R. Dumont
swh-lister
Commits
30ad6200
Verified
Commit
30ad6200
authored
4 years ago
by
Antoine R. Dumont
Browse files
Options
Downloads
Patches
Plain Diff
Drop mock_get_scheduler which creates indirection for no good reason
This is no longer useful, as removing it and tests are still ok.
parent
2ff92ef4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
conftest.py
+0
-18
0 additions, 18 deletions
conftest.py
swh/lister/pytest_plugin.py
+1
-3
1 addition, 3 deletions
swh/lister/pytest_plugin.py
swh/lister/tests/test_cli.py
+1
-1
1 addition, 1 deletion
swh/lister/tests/test_cli.py
with
2 additions
and
22 deletions
conftest.py
+
0
−
18
View file @
30ad6200
...
...
@@ -5,24 +5,6 @@
import
os
import
pytest
pytest_plugins
=
[
"
swh.scheduler.pytest_plugin
"
,
"
swh.lister.pytest_plugin
"
]
os
.
environ
[
"
LC_ALL
"
]
=
"
C.UTF-8
"
@pytest.fixture
def
mock_get_scheduler
(
monkeypatch
,
swh_scheduler
):
"""
Override the get_scheduler function in swh.lister.core.lister_base, to
return the swh_scheduler fixture.
"""
from
swh.lister.core
import
lister_base
# Match the signature from swh.scheduler.get_scheduler
def
get_scheduler
(
cls
,
args
=
{}):
return
swh_scheduler
monkeypatch
.
setattr
(
lister_base
,
"
get_scheduler
"
,
get_scheduler
)
yield
monkeypatch
This diff is collapsed.
Click to expand it.
swh/lister/pytest_plugin.py
+
1
−
3
View file @
30ad6200
...
...
@@ -54,9 +54,7 @@ def swh_config(swh_lister_config, monkeypatch, tmp_path):
@pytest.fixture
def
swh_lister
(
mock_get_scheduler
,
lister_db_url
,
swh_scheduler
,
lister_under_test
,
swh_config
):
def
swh_lister
(
lister_db_url
,
swh_scheduler
,
lister_under_test
,
swh_config
):
assert
lister_under_test
in
SUPPORTED_LISTERS
lister
=
get_lister
(
lister_under_test
,
db_url
=
lister_db_url
)
initialize
(
create_engine
(
lister_db_url
),
drop_tables
=
True
)
...
...
This diff is collapsed.
Click to expand it.
swh/lister/tests/test_cli.py
+
1
−
1
View file @
30ad6200
...
...
@@ -19,7 +19,7 @@ def test_get_lister_wrong_input():
assert
"
Invalid lister
"
in
str
(
e
.
value
)
def
test_get_lister
(
mock_get_scheduler
):
def
test_get_lister
():
"""
Instantiating a supported lister should be ok
"""
...
...
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