8000 Run unittests by palaviv · Pull Request #1650 · RustPython/RustPython · GitHub
[go: up one dir, main page]

Skip to content

Run unittests #1650

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 9 commits into from
Jan 4, 2020
Merged

Run unittests #1650

merged 9 commits into from
Jan 4, 2020

Conversation

palaviv
Copy link
Contributor
@palaviv palaviv commented Dec 28, 2019

This change include many different changes that allows us to run the CPython test using libregtest. After the change you can do:

cargo run --release Lib/test/regrtest.py
== RustPython 3.5.0alpha (heads/run-unittests-dirty:cba70133, Dec 28 2019, 10:23:15) [rustc 1.40.0]
== cwd: /tmp/test_python_19746
== CPU count: 4
== encodings: locale=UTF-8, FS=utf-8
Run tests sequentially
0:00:00 [1/1] test_bool
test_bool passed

== Tests result: SUCCESS ==

1 test OK.

Total duration: 293 ms
Tests result: SUCCESS
<SystemExit object at 0x5571b65f8a10>

This change is based on the change in #1625.

# yield
# finally:
# if have_gc:
# gc.enable()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should probably still yield here, since it's a context manager. Unless @contextlib.contextmanager works with non-generators.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

8000
ast::StringGroup::FormattedValue { value, .. } => {
ast::StringGroup::FormattedValue {
value,
conversion: _,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is what's causing the failure, in both this and the other PR. You can just add .. after the fields you actually use.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed that at #1625. You can ignore the changes there as I will rebase once it is in.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay, I didn't realize that that was passing now; I merged it.

eprintln!("Stack (most recent call first):");

Ref::map(vm.frames.borrow(), |frames| {
&for frame in frames {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just for frame in vm.frames.borrow() { ... } ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure... Fixed

@@ -264,6 +264,7 @@ pub fn make_module(vm: &VirtualMachine) -> PyObjectRef {
"strptime" => ctx.new_rustfunc(time_strptime),
"sleep" => ctx.new_rustfunc(time_sleep),
"struct_time" => struct_time_type,
"time" => ctx.new_rustfunc(time_time)
"time" => ctx.new_rustfunc(time_time),
"perf_counter" => ctx.new_rustfunc(time_time),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a TODO here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@windelbouwman
Copy link
Contributor

This is sincerely great news!

@@ -0,0 +1,5 @@
# We import importlib *ASAP* in order to test #15386
import importlib

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to place the libregrtest folder outside the Lib folder? Or has this discussion already happened?

@coolreader18 coolreader18 merged commit cdba57d into RustPython:master Jan 4, 2020
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.

3 participants
0