-
Notifications
You must be signed in to change notification settings - Fork 497
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
test: add test for mismatch package build #4785
base: main
Are you sure you want to change the base?
Conversation
test/test_mismatch_cli.py
Outdated
@pytest.mark.skipif(not LONG_TESTS(), reason="Skipping long tests") | ||
def test_package_build(build_cleanup): | ||
print("Building package") | ||
build = subprocess.run(["python", "-m", "build"], check=True) |
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.
Hello, To ensure the code runs on all systems, consider using the path to the Python executable, which can be accessed via sys.executable
and import sys
. Other than this it looks good!
build = subprocess.run(["python", "-m", "build"], check=True) | |
build = subprocess.run([sys.executable, "-m", "build"], check=True) |
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.
didn't know about this. thanks.
test/test_mismatch_cli.py
Outdated
build = subprocess.run(["python", "-m", "build"], check=True) | ||
assert build.returncode == 0, "Python build failed" | ||
|
||
print("Install package") |
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.
print("Install package") |
We should not have any print statements in a test file
replace 'python' with 'sys.executable' in test_package_build() test
Thank you writing tests for #4669 (referencing it here as well). just one more thing from my side |
Fixes #4681
Changes:
test/test_mismatch_cli.py
to add a test to check whether themismatch
package will be properly build and run or not.build
dependency indev-requirements.txt
which is required for building the package for testing.