-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
685 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Features | ||
## Overview | ||
The following table lists the supported places where executing can be used to map to a ast-node. | ||
| name | 2.7 | 3.5 | 3.6 | 3.7 | 3.8 | 3.9 | 3.10 | 3.11 | pypy2.7 | pypy3.5 | pypy3.6 | | ||
|-----------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|------------------|------------------|--------------------|--------------------|--------------------| | ||
| binary operators| :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |:heavy_check_mark:|:heavy_check_mark:| :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | ||
|`a(arguments...)`| :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |:heavy_check_mark:|:heavy_check_mark:| :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | ||
| `del obj.attr` |(:white_check_mark:)|(:white_check_mark:)|(:white_check_mark:)|(:white_check_mark:)| :heavy_check_mark: | :heavy_check_mark: |:heavy_check_mark:|:heavy_check_mark:|(:white_check_mark:)|(:white_check_mark:)|(:white_check_mark:)| | ||
| `obj.attr` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |:heavy_check_mark:|:heavy_check_mark:| :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | ||
| `obj.attr = 5` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |:heavy_check_mark:|:heavy_check_mark:| :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | ||
|`with something:`| :x: | :x: | :x: | :x: |(:white_check_mark:)|(:white_check_mark:)|:heavy_check_mark:|:heavy_check_mark:| :x: | :x: | :x: | | ||
## Details | ||
|
||
### binary operators | ||
|
||
the node of an binary operation can be obtained inside a `__add__` or other binary operator. | ||
|name| 2.7 | 3.5 | 3.6 | 3.7 | 3.8 | 3.9 | 3.10 | 3.11 | pypy2.7 | pypy3.5 | pypy3.6 | | ||
|----|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| | ||
| `+`|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:| | ||
| `-`|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:| | ||
| `/`|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:| | ||
|`//`|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:| | ||
|
||
### `a(arguments...)` | ||
|
||
the node of an binary operation can be obtained inside function or `__call__` operator. | ||
| name | 2.7 | 3.5 | 3.6 | 3.7 | 3.8 | 3.9 | 3.10 | 3.11 | pypy2.7 | pypy3.5 | pypy3.6 | | ||
|------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| | ||
|`call`|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:| | ||
|
||
### `del obj.attr` | ||
|
||
the node can be accessed inside the `__setattr__` function. | ||
| name | 2.7 | 3.5 | 3.6 | 3.7 | 3.8 | 3.9 | 3.10 | 3.11 | pypy2.7 | pypy3.5 | pypy3.6 | | ||
|---------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| | ||
| `del obj.attr` | :x: | :x: | :x: | :x: |:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:| :x: | :x: | :x: | | ||
|`delattr(obj,"attr")`|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:| | ||
|
||
### `obj.attr` | ||
|
||
the node can be accessed inside the `__getattr__` function. | ||
| name | 2.7 | 3.5 | 3.6 | 3.7 | 3.8 | 3.9 | 3.10 | 3.11 | pypy2.7 | pypy3.5 | pypy3.6 | | ||
|---------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| | ||
|`getattr(obj,"attr")`|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:| | ||
| `obj.attr` |:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:| | ||
|
||
### `obj.attr = 5` | ||
|
||
the node can be accessed inside the `__setattr__` function. | ||
| name | 2.7 | 3.5 | 3.6 | 3.7 | 3.8 | 3.9 | 3.10 | 3.11 | pypy2.7 | pypy3.5 | pypy3.6 | | ||
|----------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| | ||
| `setattr(t,"attr",5)`|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:| | ||
| `t.attr = 5` |:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:| | ||
|`t.attr, g.attr= 5, 5`|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:| | ||
|
||
### `with something:` | ||
|
||
__enter__ and __exit__ | ||
| name |2.7|3.5|3.6|3.7| 3.8 | 3.9 | 3.10 | 3.11 |pypy2.7|pypy3.5|pypy3.6| | ||
|-----------|---|---|---|---|------------------|------------------|------------------|------------------|-------|-------|-------| | ||
|`__enter__`|:x:|:x:|:x:|:x:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:| :x: | :x: | :x: | | ||
| `__exit__`|:x:|:x:|:x:|:x:| :x: | :x: |:heavy_check_mark:|:heavy_check_mark:| :x: | :x: | :x: | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import pytest | ||
|
||
|
||
@pytest.hookimpl(tryfirst=True, hookwrapper=True) | ||
def pytest_runtest_makereport(item, call): | ||
# execute all other hooks to obtain the report object | ||
outcome = yield | ||
rep = outcome.get_result() | ||
|
||
# set a report attribute for each phase of a call, which can | ||
# be "setup", "call", "teardown" | ||
|
||
setattr(item, "rep_" + rep.when, rep) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"test_binary_operators": { | ||
"//": true, | ||
"+": true, | ||
"-": true, | ||
"/": true | ||
}, | ||
"test_getattr": { | ||
"getattr(obj,\"attr\")": true, | ||
"obj.attr": true | ||
}, | ||
"test_call": { | ||
"call": true | ||
}, | ||
"test_setattr": { | ||
"t.attr, g.attr= 5, 5": true, | ||
"t.attr = 5": true, | ||
"setattr(t,\"attr\",5)": true | ||
}, | ||
"test_with": { | ||
"__exit__": false, | ||
"__enter__": false | ||
}, | ||
"test_delattr": { | ||
"delattr(obj,\"attr\")": true, | ||
"del obj.attr": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"test_binary_operators": { | ||
"+": true, | ||
"-": true, | ||
"/": true, | ||
"//": true | ||
}, | ||
"test_call": { | ||
"call": true | ||
}, | ||
"test_getattr": { | ||
"obj.attr": true, | ||
"getattr(obj,\"attr\")": true | ||
}, | ||
"test_setattr": { | ||
"t.attr = 5": true, | ||
"t.attr, g.attr= 5, 5": true, | ||
"setattr(t,\"attr\",5)": true | ||
}, | ||
"test_delattr": { | ||
"del obj.attr": true, | ||
"delattr(obj,\"attr\")": true | ||
}, | ||
"test_with": { | ||
"__enter__": true, | ||
"__exit__": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"test_binary_operators": { | ||
"+": true, | ||
"-": true, | ||
"/": true, | ||
"//": true | ||
}, | ||
"test_call": { | ||
"call": true | ||
}, | ||
"test_getattr": { | ||
"obj.attr": true, | ||
"getattr(obj,\"attr\")": true | ||
}, | ||
"test_setattr": { | ||
"t.attr = 5": true, | ||
"t.attr, g.attr= 5, 5": true, | ||
"setattr(t,\"attr\",5)": true | ||
}, | ||
"test_delattr": { | ||
"del obj.attr": true, | ||
"delattr(obj,\"attr\")": true | ||
}, | ||
"test_with": { | ||
"__enter__": true, | ||
"__exit__": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"test_with": { | ||
"__exit__": false, | ||
"__enter__": false | ||
}, | ||
"test_delattr": { | ||
"delattr(obj,\"attr\")": true, | ||
"del obj.attr": false | ||
}, | ||
"test_setattr": { | ||
"t.attr = 5": true, | ||
"t.attr, g.attr= 5, 5": true, | ||
"setattr(t,\"attr\",5)": true | ||
}, | ||
"test_getattr": { | ||
"obj.attr": true, | ||
"getattr(obj,\"attr\")": true | ||
}, | ||
"test_call": { | ||
"call": true | ||
}, | ||
"test_binary_operators": { | ||
"//": true, | ||
"+": true, | ||
"/": true, | ||
"-": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"test_binary_operators": { | ||
"+": true, | ||
"-": true, | ||
"/": true, | ||
"//": true | ||
}, | ||
"test_call": { | ||
"call": true | ||
}, | ||
"test_getattr": { | ||
"obj.attr": true, | ||
"getattr(obj,\"attr\")": true | ||
}, | ||
"test_setattr": { | ||
"t.attr = 5": true, | ||
"t.attr, g.attr= 5, 5": true, | ||
"setattr(t,\"attr\",5)": true | ||
}, | ||
"test_delattr": { | ||
"del obj.attr": false, | ||
"delattr(obj,\"attr\")": true | ||
}, | ||
"test_with": { | ||
"__enter__": false, | ||
"__exit__": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"test_binary_operators": { | ||
"+": true, | ||
"-": true, | ||
"/": true, | ||
"//": true | ||
}, | ||
"test_call": { | ||
"call": true | ||
}, | ||
"test_getattr": { | ||
"obj.attr": true, | ||
"getattr(obj,\"attr\")": true | ||
}, | ||
"test_setattr": { | ||
"t.attr = 5": true, | ||
"t.attr, g.attr= 5, 5": true, | ||
"setattr(t,\"attr\",5)": true | ||
}, | ||
"test_delattr": { | ||
"del obj.attr": false, | ||
"delattr(obj,\"attr\")": true | ||
}, | ||
"test_with": { | ||
"__enter__": false, | ||
"__exit__": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"test_binary_operators": { | ||
"+": true, | ||
"-": true, | ||
"/": true, | ||
"//": true | ||
}, | ||
"test_call": { | ||
"call": true | ||
}, | ||
"test_getattr": { | ||
"obj.attr": true, | ||
"getattr(obj,\"attr\")": true | ||
}, | ||
"test_setattr": { | ||
"t.attr = 5": true, | ||
"t.attr, g.attr= 5, 5": true, | ||
"setattr(t,\"attr\",5)": true | ||
}, | ||
"test_delattr": { | ||
"del obj.attr": true, | ||
"delattr(obj,\"attr\")": true | ||
}, | ||
"test_with": { | ||
"__enter__": true, | ||
"__exit__": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"test_binary_operators": { | ||
"+": true, | ||
"-": true, | ||
"/": true, | ||
"//": true | ||
}, | ||
"test_call": { | ||
"call": true | ||
}, | ||
"test_getattr": { | ||
"obj.attr": true, | ||
"getattr(obj,\"attr\")": true | ||
}, | ||
"test_setattr": { | ||
"t.attr = 5": true, | ||
"t.attr, g.attr= 5, 5": true, | ||
"setattr(t,\"attr\",5)": true | ||
}, | ||
"test_delattr": { | ||
"del obj.attr": true, | ||
"delattr(obj,\"attr\")": true | ||
}, | ||
"test_with": { | ||
"__enter__": true, | ||
"__exit__": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"test_binary_operators": { | ||
"+": true, | ||
"-": true, | ||
"/": true, | ||
"//": true | ||
}, | ||
"test_call": { | ||
"call": true | ||
}, | ||
"test_getattr": { | ||
"obj.attr": true, | ||
"getattr(obj,\"attr\")": true | ||
}, | ||
"test_setattr": { | ||
"t.attr = 5": true, | ||
"t.attr, g.attr= 5, 5": true, | ||
"setattr(t,\"attr\",5)": true | ||
}, | ||
"test_delattr": { | ||
"del obj.attr": false, | ||
"delattr(obj,\"attr\")": true | ||
}, | ||
"test_with": { | ||
"__enter__": false, | ||
"__exit__": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"test_binary_operators": { | ||
"+": true, | ||
"-": true, | ||
"/": true, | ||
"//": true | ||
}, | ||
"test_call": { | ||
"call": true | ||
}, | ||
"test_getattr": { | ||
"obj.attr": true, | ||
"getattr(obj,\"attr\")": true | ||
}, | ||
"test_setattr": { | ||
"t.attr = 5": true, | ||
"t.attr, g.attr= 5, 5": true, | ||
"setattr(t,\"attr\",5)": true | ||
}, | ||
"test_delattr": { | ||
"del obj.attr": false, | ||
"delattr(obj,\"attr\")": true | ||
}, | ||
"test_with": { | ||
"__enter__": false, | ||
"__exit__": false | ||
} | ||
} |
Oops, something went wrong.