Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
psaap3-weno
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
Model registry
Operate
Environments
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
Andreas Klöckner
psaap3-weno
Commits
f77caa25
Commit
f77caa25
authored
5 years ago
by
Timothy A. Smith
Browse files
Options
Downloads
Patches
Plain Diff
tests marked with @pytest.mark.slow will be skipped by default, but not by the CI script
parent
112064d1
No related branches found
Branches containing commit
No related tags found
2 merge requests
!9
Mark slow tests
,
!8
Test refactoring
Pipeline
#17910
passed
5 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
build-and-test-py-project.sh
+1
-1
1 addition, 1 deletion
build-and-test-py-project.sh
conftest.py
+21
-0
21 additions, 0 deletions
conftest.py
with
22 additions
and
1 deletion
build-and-test-py-project.sh
+
1
−
1
View file @
f77caa25
...
...
@@ -85,6 +85,6 @@ if test -f $REQUIREMENTS_TXT; then
$PIP
install
-r
$REQUIREMENTS_TXT
fi
${
PY_EXE
}
-m
pytest
-rw
--durations
=
10
--tb
=
native
--junitxml
=
pytest.xml
-rxsw
test.py
${
PY_EXE
}
-m
pytest
-rw
--durations
=
10
--tb
=
native
--junitxml
=
pytest.xml
-rxsw
--runslow
test.py
# vim: foldmethod=marker
This diff is collapsed.
Click to expand it.
conftest.py
0 → 100644
+
21
−
0
View file @
f77caa25
# setup to mark slow tests with @pytest.mark.slow, so that they don't run by
# default, but can be forced to run with the command-line option --runslow
# taken from
# https://docs.pytest.org/en/latest/example/simple.html#control-skipping-of-tests-according-to-command-line-option
import
pytest
def
pytest_addoption
(
parser
):
parser
.
addoption
(
"
--runslow
"
,
action
=
"
store_true
"
,
default
=
False
,
help
=
"
run slow tests
"
)
def
pytest_collection_modifyitems
(
config
,
items
):
if
config
.
getoption
(
"
--runslow
"
):
# --runslow given in cli: do not skip slow tests
return
skip_slow
=
pytest
.
mark
.
skip
(
reason
=
"
need --runslow option to run
"
)
for
item
in
items
:
if
"
slow
"
in
item
.
keywords
:
item
.
add_marker
(
skip_slow
)
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