-
Notifications
You must be signed in to change notification settings - Fork 578
test: add test for mismatch package build #4785
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
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 |
the dev-requirements are not in alphabetical order anyways so i just put it at the end |
|
Hi @terriko |
|
I'm going to update this branch because we had some difficulties with tests on python 3.10 and updated that job to use python 3.13. If it fails this time you may have to fix it, though! |
terriko
left a comment
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.
Looks like the tests fails are unrelated, so we're good to get this merged. Congrats on your first merged PR with us, @kanakOS01 !
Fixes #4681
Changes:
test/test_mismatch_cli.pyto add a test to check whether themismatchpackage will be properly build and run or not.builddependency indev-requirements.txtwhich is required for building the package for testing.