-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Update uu.py
and test_uu.py
from CPython v3.12.0
#5161
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
Usually, the commits that have anything to do with RustPython are separated from the commits that contain changes made in CPython by CPython developers. |
One of the failing test is |
59e9920
to
8382dc8
Compare
@kingiler is this intended to be closed or accident? |
@youknowone It was an accident. I messed up with the git force push commit before. |
Now I found the potential cause for the issue. Comment out introducing of |
@youknowone I have a strange issue that this PR does not sync with my branch at https://github.com/kingiler/RustPython/tree/update_uu, do you know what is happening here? |
it happens sometimes when you pushed it during parts of github is out of service. you can edit the last commit by |
Source_LoaderTests | ||
) = util.test_both(LoaderTests, machinery=machinery) | ||
# TODO: RUSTPYTHON | ||
# (Frozen_LoaderTests, |
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.
Do you have any idea which part of this test fails?
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.
We can't simply disable importlib test because it is one of the most important part. We need to investigate what's happening here.
Co-authored-by: Jeong, YunWon <jeong@youknowone.org>
Signed-off-by: wellweek <xiezitai@outlook.com>
The failing test was unsetting `PYTHONPATH`, but neglecting to unset `RUSTPYTHONPATH`, which obviously was not significant for the original CPython test. Including `RUSTPYTHONPATH` in the test fixes it.
There are a substantial number of socket tests that are disabled due to `bind(): bad family` errors. It seems like RustPython only supports a small subset of the required connection families, so the failing tests are broken for the same reasons.
Technically speaking, my system was misconfigured, leading me to disable the test in the first place. `test_locale` calls `locale.setlocale(locale.LC_ALL, '')`, which reads the value of the `LANG` environment variable and uses that to look up and reset all the locale settings. My system has `LANG=en_US.UTF-8`, which is apparently not what this test was expecting. If `LANG` is unset or set to `C`, the test passes, as it does in CI.
I had previously `test_locale` as expected to fail, as it did indeed fail on my system due to unimplemented functionality. As it happens, it passes in CI because the locale settings used there (`C`, I believe) just happen to format integers the same with "%d" as "%n". I mistakenly un-marked it because I thought I misunderstood the problem.
…#5201) After you suggestion in python/cpython#116504 (comment) I went to take a look at `test_cmd_line` in RustPython (it was so long ago I contributed to this amazing project, so may thing had changed!), and I've noticed this. This is a problem, here' the simplest demo: ```python import unittest class TestMe(unittest.TestCase): @unittest.expectedFailure def test_me(self): def run(): raise ValueError with self.subTest(run=run): run() if __name__ == '__main__': unittest.main() ``` This works as expected: ``` » ./python.exe ex.py x ---------------------------------------------------------------------- Ran 1 test in 0.001s OK (expected failures=1) ``` This does not: ```python import unittest class TestMe(unittest.TestCase): def test_me(self): @unittest.expectedFailure def run(): raise ValueError with self.subTest(run=run): run() if __name__ == '__main__': unittest.main() ``` Produces: ``` » ./python.exe ex.py E ====================================================================== ERROR: test_me (__main__.TestMe.test_me) (run=<function TestMe.test_me.<locals>.run at 0x1057a2150>) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/sobolev/Desktop/cpython2/ex.py", line 10, in test_me run() ~~~^^ File "/Users/sobolev/Desktop/cpython2/ex.py", line 7, in run raise ValueError ValueError ---------------------------------------------------------------------- Ran 1 test in 0.001s FAILED (errors=1) ``` So, I propose to remove these decorators, let's only keep `TODO` comments to indicate separate failures.
If removing deprecated warning fix importlib problem, it will be the best. |
I somehow debug that the issue comes from |
@youknowone should we closed this PR and make a notice on update list that |
@kingiler I'd like to merge it if it is easy to fix. Otherwise let it just be removed later. |
Thank you for contributing. I am going to close this because we are targetting 3.13 and uu is removed. |
Pass more unit tests in test_uu.py