22 Commits

Author SHA1 Message Date
Noa
e4be882994 Miscellaneous cli-related parity fixes 2024-12-03 16:28:32 -06:00
James Clarke
e142d655b9 changed int_max_str_digits from -1 to 4300 to be more cpython complient (#5343)
* changed int_max_str_digits from -1 to 4300 to be more cpython complient, fixes #5139
2024-06-27 15:27:54 +09:00
Nikita Sobolev
426e582ba0 Remove incorrect @expectedFailures from test_cmd_line (#5201)
After you suggestion in https://github.com/python/cpython/issues/116504#issuecomment-1999239012 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.
2024-03-15 22:15:45 +09:00
Daniel Chiquito
35229721ea Fix test_cmd_line.py
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.
2024-03-09 18:22:57 -05:00
NakanoMiku
999dcbdd1b Edit test_cmd_line.py 2023-11-30 19:48:22 +08:00
NakanoMiku
06bb68a6c6 Update test_cmd_line.py from CPython v3.12.0 2023-11-30 19:45:47 +08:00
Bobby Palmer
a58ede99f2 add int_max_str_digits input from command line (#5021)
* added int_max_str_digits to settings struct

* changed vm init to use the value from settings

* added error handling and set the settings default to -1 which sets the value to 4300
2023-07-06 01:24:11 +09:00
Andrey Maltsev
cf06c25904 fix windows tests 2023-04-08 18:57:07 +00:00
Andrey Maltsev
8ec024a8fd fix windows 2023-04-04 08:10:56 +00:00
Andrey Maltsev
e7165e8b6e fix tests 2023-04-02 18:41:14 +00:00
Andrey Maltsev
fa26b6815d wft 2023-04-02 15:23:40 +00:00
Andrey Maltsev
1862d1d827 Update test_cmd_line from Cpython v3.11.2 2023-04-02 12:46:39 +00:00
Jeong YunWon
6ee827bd8a Fix CR/LF of python libraries 2023-02-28 17:11:41 +09:00
Moreal
6d017420c5 Unmark resolved tests 2022-08-13 08:39:58 +09:00
Dean Li
6f98288e84 test: use import_helper 2021-11-29 21:03:02 +08:00
Dean Li
5ee4fb899b test: use os_helper 2021-11-28 20:51:32 +08:00
Jeong YunWon
0ad3a29cac Remove TODO from RustPython-invalid test_cmd_line.test_version 2021-11-27 01:34:39 +09:00
Jeong YunWon
913b78ca44 Revert "Merge pull request #3433 from deantvv/test-update"
This reverts commit 9fa5c5ac66, reversing
changes made to e7fa32c687.
2021-11-17 17:06:51 +09:00
Dean Li
49a5805d11 test: use os_helper 2021-11-13 02:18:33 +00:00
Padraic Fanning
8dfa89ea58 Clean up skips in test_cmd_line 2021-10-10 19:11:24 -04:00
snowapril
fc6e9df2d1 add annotations for making test success
Signed-off-by: snowapril <sinjihng@gmail.com>
2021-09-06 18:55:23 +09:00
snowapril
18fb063be6 add test_cmd_line.py from cpython 3.8
Signed-off-by: snowapril <sinjihng@gmail.com>
2021-09-06 18:55:23 +09:00