ehmatthes / ehmatthes/py-bugger

If appropriate, move on to another exception type if current can't be induced

Open
#61 1 comment 0 reactions 0 assignees View on GitHub
1.0 release
Dominant language
Python
Stars
41
Forks
22
PR merge metrics
No merged PRs in 30d

Description

Right now, if the current exception type can't be induced, we just move on to the next one in the list. But that's not appropriate behavior if we chose that exception type randomly.

For example, consider the call `py-bugger -n 2`. The random selections are `["ModuleNotFoundError", "AttributeError"]`. If a ModuleNotFoundError can't be induced, we'll only give one bug. We should remove ModuleNotFoundError from pool of possible exception types, and pull another random exception type from possible types.

Tasks
---

- [ ] Failing test
- [ ] Implement support
- [ ] Passing test
- [ ] Update docs?
- [ ] Merge
- [ ] Release
- [ ] Announce

Possible approach
---

- [ ] Make a list, `possible_exceptions`, which is initialized to a copy of `SUPPORTED_EXCEPTION_TYPES`. If an exception type can't be induced, remove that type from this list. When removing, resample from `possible_exceptions` if we originally chose exception types randomly.
- [ ] Main loop will move from a `for` loop to `while requested_bugs and possible_exceptions`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.