Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Gaudi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Gaudi
Gaudi
Commits
ddadceb1
Commit
ddadceb1
authored
2 weeks ago
by
Marco Clemencic
Browse files
Options
Downloads
Plain Diff
Fix test name when gaudi_add_pytest is passed a test file
Closes
#354
See merge request
!1713
parents
317a77cf
1b5507d0
No related branches found
No related tags found
1 merge request
!1713
Fix test name when gaudi_add_pytest is passed a test file
Pipeline
#11049433
passed
2 weeks ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
GaudiPolicy/python/GaudiTesting/pytest/collect_for_ctest.py
+8
-3
8 additions, 3 deletions
GaudiPolicy/python/GaudiTesting/pytest/collect_for_ctest.py
with
8 additions
and
3 deletions
GaudiPolicy/python/GaudiTesting/pytest/collect_for_ctest.py
+
8
−
3
View file @
ddadceb1
...
...
@@ -133,11 +133,16 @@ def pytest_collection_finish(session):
fixtures
=
defaultdict
(
list
)
# fixture name -> list of tests that produce it
names
=
[]
for
path
in
sorted
(
session
.
ctest_files
):
name
=
(
args
[
"
prefix
"
]
+
os
.
path
.
relpath
(
path
,
args
[
"
pytest_root_dir
"
])
).
replace
(
"
/
"
,
"
.
"
)
name
=
os
.
path
.
relpath
(
path
,
args
[
"
pytest_root_dir
"
]).
replace
(
"
/
"
,
"
.
"
)
if
name
.
endswith
(
"
.py
"
):
name
=
name
[:
-
3
]
if
name
==
"
.
"
:
# when we pass a single file to pytest, pytest_root_dir and path are the same
# and relpath returns ".", so we take the prefix and drop the final dot
# (see https://gitlab.cern.ch/gaudi/Gaudi/-/issues/354)
name
=
args
[
"
prefix
"
][:
-
1
]
else
:
name
=
args
[
"
prefix
"
]
+
name
pytest_cmd
=
args
[
"
pytest_command
"
]
output
.
write
(
...
...
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