Skip to content

Add test to Lib and allow test_bool.py to run #1587

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

Merged
merged 2 commits into from
Nov 23, 2019

Conversation

palaviv
Copy link
Contributor

@palaviv palaviv commented Nov 7, 2019

After this change you can run test_bool.py from CPython:

cargo run --release Lib/test/test_bool.py
    Finished release [optimized] target(s) in 0.10s
     Running `target/release/rustpython Lib/test/test_bool.py`
test_blocked (__main__.BoolTest) ... ok
test_boolean (__main__.BoolTest) ... ok
test_callable (__main__.BoolTest) ... ok
test_contains (__main__.BoolTest) ... ok
test_convert (__main__.BoolTest) ... ok
test_convert_to_bool (__main__.BoolTest) ... ok
test_fileclosed (__main__.BoolTest) ... ERROR
test_float (__main__.BoolTest) ... ok
test_format (__main__.BoolTest) ... ok
test_from_bytes (__main__.BoolTest) ... FAIL
test_hasattr (__main__.BoolTest) ... ok
test_int (__main__.BoolTest) ... ok
test_isinstance (__main__.BoolTest) ... ok
test_issubclass (__main__.BoolTest) ... ok
test_keyword_args (__main__.BoolTest) ... FAIL
test_marshal (__main__.BoolTest) ... ERROR
test_math (__main__.BoolTest) ... FAIL
test_operator (__main__.BoolTest) ... ok
test_pickle (__main__.BoolTest) ... ERROR
test_picklevalues (__main__.BoolTest) ... ERROR
test_print (__main__.BoolTest) ... ERROR
test_real_and_imag (__main__.BoolTest) ... ok
test_repr (__main__.BoolTest) ... ok
test_sane_len (__main__.BoolTest) ... ok
test_str (__main__.BoolTest) ... ok
test_string (__main__.BoolTest) ... FAIL
test_subclass (__main__.BoolTest) ... FAIL
test_types (__main__.BoolTest) ... ok

======================================================================
ERROR: test_fileclosed (__main__.BoolTest)
----------------------------------------------------------------------
AttributeError: AttributeError("'TextIOWrapper' object has no attribute 'closed'",)

======================================================================
ERROR: test_marshal (__main__.BoolTest)
----------------------------------------------------------------------
TypeError: TypeError("Expected type <class 'code'>, not <class 'bool'>",)

======================================================================
ERROR: test_pickle (__main__.BoolTest)
----------------------------------------------------------------------
ModuleNotFoundError: ModuleNotFoundError("No module named 'pickle'",)

======================================================================
ERROR: test_picklevalues (__main__.BoolTest)
----------------------------------------------------------------------
ModuleNotFoundError: ModuleNotFoundError("No module named 'pickle'",)

======================================================================
ERROR: test_print (__main__.BoolTest)
----------------------------------------------------------------------
TypeError: TypeError("Expected type <class 'str'>, not <class 'bool'>",)

======================================================================
FAIL: test_from_bytes (__main__.BoolTest)
----------------------------------------------------------------------
AssertionError: AssertionError('0 is not False',)

======================================================================
FAIL: test_keyword_args (__main__.BoolTest)
----------------------------------------------------------------------
AssertionError: AssertionError('TypeError not raised',)

======================================================================
FAIL: test_math (__main__.BoolTest)
----------------------------------------------------------------------
AssertionError: AssertionError('unexpectedly identical: False',)

======================================================================
FAIL: test_string (__main__.BoolTest)
----------------------------------------------------------------------
AssertionError: AssertionError('False is not True',)

======================================================================
FAIL: test_subclass (__main__.BoolTest)
----------------------------------------------------------------------
AssertionError: AssertionError('bool should not be subclassable',)

----------------------------------------------------------------------

Ran 28 tests in 0.050s

FAILED (failures=5, errors=5)
Traceback (most recent call last):
  File "Lib/test/test_bool.py", line 369, in <module>
    test_main()
  File "Lib/test/test_bool.py", line 366, in test_main
    support.run_unittest(BoolTest)
  File "/home/aviv/dev/RustPython/Lib/test/support/__init__.py", line 2075, in run_unittest
    elif isinstance(cls, valid_types):
  File "/home/aviv/dev/RustPython/Lib/test/support/__init__.py", line 1994, in _run_suite
    elif len(result.failures) == 1 and not result.errors:
TestFailed: multiple errors occurred

The output is after the fix in #1582

@palaviv palaviv changed the title Add test to Lib and allow test_boo.py to run Add test to Lib and allow test_bool.py to run Nov 7, 2019
@coolreader18
Copy link
Member

LGTM

@coolreader18 coolreader18 merged commit 60ebba2 into RustPython:master Nov 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants