-
Notifications
You must be signed in to change notification settings - Fork 1
Explicitly set pytest rootdir option for running tests #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
When trying to run ska_testr / testr from this PR I'm now getting
|
I had been playing with "args = args + ('--rootdir', pkg_dir)" but hadn't looked at pytest args vs kwargs. |
I put what I was doing that seemed to work (without as many ../../../../ paths in the test output as testr master) in #53 . I think we need a real 2025.1 candidate environment with a defined pytest version though before we can do appropriate functional testing and pick something reasonable for our use cases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not work for me in a standard ska_testr / run_testr use case.
@jeanconn - OK, the first draft wasn't entirely baked, but please give the latest a go. I realized that |
And I added some functional testing which covers the other half of the main runner functionality |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. This works for me now in the standard use cases.
Description
Fixes sot/skare3#1294
Interface impacts
Tested with pytest == 8.3.4 .
Testing
Unit tests
Functional tests
Hoping for help from @jeanconn or @javierggt.
Testing .test()
From this github repo, test the test runner via the
>>> package.test(*args, **kwargs)
path.I also put in a temporary statement to print the
args
that get passed to thepytest
call and confirmed the expected--rootdir
.For other functional testing, @jeanconn ran tests for a single package from ska_testr and confirmed success with pytest 8.3.4
The rootdir looks appropriate to my installation, though it is a bit amusing that the pytest.ini is now relative.
For reference, this was the top matter with testr master