Message405319
I've decided to test `typing.py` with `cosmic-ray` mutation testing framework. It identified 3 potential problems.
Config:
```
[cosmic-ray]
module-path = "Lib/typing.py"
timeout = 15.0
excluded-modules = []
test-command = "./python.exe -m test -v test_typing --failfast"
[cosmic-ray.distributor]
name = "local"
```
Repro steps:
0. pip install cosmic-ray
1. Copy config above as `typing.toml`
2. cosmic-ray init typing.toml typing.sqlite
3. cosmic-ray exec tutorial.toml tutorial.sqlite
Survived mutants:
1. ```
--- mutation diff ---
--- aLib/typing.py
+++ bLib/typing.py
@@ -1103,7 +1103,7 @@
if Protocol in bases:
return ()
i = bases.index(self)
- for b in bases[i+1:]:
+ for b in bases[i*1:]:
if isinstance(b, _BaseGenericAlias) and b is not self:
return ()
return (self.__origin__,)
```
2. ```
--- mutation diff ---
--- aLib/typing.py
+++ bLib/typing.py
@@ -1103,7 +1103,7 @@
if Protocol in bases:
return ()
i = bases.index(self)
- for b in bases[i+1:]:
+ for b in bases[i//1:]:
if isinstance(b, _BaseGenericAlias) and b is not self:
return ()
return (self.__origin__,)
```
3. ```
--- mutation diff ---
--- aLib/typing.py
+++ bLib/typing.py
@@ -1103,7 +1103,7 @@
if Protocol in bases:
return ()
i = bases.index(self)
- for b in bases[i+1:]:
+ for b in bases[i**1:]:
if isinstance(b, _BaseGenericAlias) and b is not self:
return ()
return (self.__origin__,)
```
I've attached the full report to this issue if it is interesting to anyone: https://gist.github.com/sobolevn/79f1729dcf0b8c4b2a9bcee67027673a |
|
Date |
User |
Action |
Args |
2021-10-29 16:52:34 | sobolevn | set | recipients:
+ sobolevn |
2021-10-29 16:52:34 | sobolevn | set | messageid: <1635526354.62.0.519981897591.issue45672@roundup.psfhosted.org> |
2021-10-29 16:52:34 | sobolevn | link | issue45672 messages |
2021-10-29 16:52:34 | sobolevn | create | |
|