Skip to content
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

Fix assertion error when analyzing a sklearn module #72

Merged
merged 1 commit into from
Jun 14, 2024

Conversation

BergLucas
Copy link
Contributor

Hi,

This pull request fixes the bug I've explained in issue #71.

I'm pretty sure that the problem is just an error in the assertion because if len(self.contexts) > 1 at the line 322, then the condition len(self.contexts) < 2 in the if statement at line 323 will never be True since there is no integer x that verifies the proposition 1 < x < 2. I've added a = in the assertion to fix the bug.

I changed the other part of the code because while I was looking for the source of the bug, I often converted the AST to a string using the ast.unparse function and this function crashed because some of the arguments of the ast.Call node were missing. I'm pretty sure this is also a small bug.

Have a nice day!

stephanlukasczyk added a commit that referenced this pull request Jun 14, 2024
- Add possibility to control number of mutations in MOSA.
- Compute the area under curve if Pynguin traces the coverage over time;
  area under curve can be interpreted as the integral over the coverage
  function, which is computed via trapezoidal approximation.
- Fix the assertion generation for `float`s (thanks to @BergLucas in #70)
- Fix assertions and invalid function call (thanks to @BergLucas in #72)
@stephanlukasczyk stephanlukasczyk merged commit 3174e37 into se2p:main Jun 14, 2024
2 checks passed
@BergLucas BergLucas deleted the fix/syntax-tree-analyser branch June 16, 2024 00:34
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.

2 participants