We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c868cc3 commit 328d61cCopy full SHA for 328d61c
tests/test_class_basics.rs
@@ -66,14 +66,17 @@ fn empty_class_in_module() {
66
ty.getattr("__name__").unwrap().extract::<String>().unwrap(),
67
"EmptyClassInModule"
68
);
69
+
70
+ let builtin = if cfg!(feature = "python2") {
71
+ "__builtin__"
72
+ } else {
73
+ "builtins"
74
+ };
75
76
+ let module: String = ty.getattr("__module__").unwrap().extract().unwrap();
77
78
// Rationale: The class can be added to many modules, but will only be initialized once.
79
// We currently have no way of determining a canonical module, so builtins is better
80
// than using whatever calls init first.
- assert_eq!(
- ty.getattr("__module__")
- .unwrap()
- .extract::<String>()
- .unwrap(),
- "builtins"
- );
81
+ assert_eq!(module, builtin);
82
}
0 commit comments